Skip to content
Snippets Groups Projects
Commit f65ea30b authored by brinn's avatar brinn
Browse files

Use managed query rather than data source for experimentSampleQuery.

SVN: 27567
parent 5bef24fc
No related branches found
No related tags found
No related merge requests found
......@@ -87,8 +87,7 @@ public class ExperimentDAO extends AbstractGenericEntityWithPropertiesDAO<Experi
final DatabaseInstancePE databaseInstance)
{
super(persistencyResources, databaseInstance, ExperimentPE.class);
this.experimentSampleQuery =
QueryTool.getQuery(getDataSource(), IExperimentSampleQuery.class);
this.experimentSampleQuery = QueryTool.getManagedQuery(IExperimentSampleQuery.class);
}
@Override
......@@ -376,29 +375,13 @@ public class ExperimentDAO extends AbstractGenericEntityWithPropertiesDAO<Experi
private List<Long> getSampleIds(ExperimentPE experiment)
{
try
{
return experimentSampleQuery.getExperimentSampleIds(experiment.getId());
} finally
{
// Force explicitly returning the database connection as otherwise we have a database
// connection leak here.
experimentSampleQuery.close();
}
return experimentSampleQuery.getExperimentSampleIds(experiment.getId());
}
@Override
public List<String> getSampleCodes(ExperimentPE experiment)
{
try
{
return experimentSampleQuery.getExperimentSampleCodes(experiment.getId());
} finally
{
// Force explicitly returning the database connection as otherwise we have a database
// connection leak here.
experimentSampleQuery.close();
}
return experimentSampleQuery.getExperimentSampleCodes(experiment.getId());
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment