Skip to content

Commit 65eab63

Browse files
author
Alex Manoylenko
committed
Adding comment for cohortDefinition.getDetails().getExpression() necessity
1 parent 614ff5b commit 65eab63

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/org/ohdsi/webapi/service/CohortGenerationService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ public JobExecutionResource generateCohortViaJob(UserEntity userEntity, CohortDe
111111
.setStartTime(Calendar.getInstance().getTime());
112112

113113
cohortDefinitionRepository.save(cohortDefinition);
114-
114+
// the line below is essential to access the Cohort definition details in GenerateLocalCohortTasklet.generateCohort
115+
// and avoid org.hibernate.LazyInitializationException:
116+
// could not initialize proxy [org.ohdsi.webapi.cohortdefinition.CohortDefinitionDetails#38] - no Session
117+
// the workaround doesn't look pure in the same time refactoring doesn't look minor
118+
// as a lot of components are instantiated by the new operator
115119
cohortDefinition.getDetails().getExpression();
116120

117121
return runGenerateCohortJob(cohortDefinition, source, demographicStat); }

0 commit comments

Comments
 (0)