From 6208eefab7a591b44ebce32addd5f9c3a0887407 Mon Sep 17 00:00:00 2001
From: tpylak <tpylak>
Date: Tue, 13 Jul 2010 14:58:53 +0000
Subject: [PATCH] SE-271 fix race condition: do not reuse the query in all
 servlet instances. One servlet can close the query which is just beng used by
 another one.

SVN: 17012
---
 .../cisd/openbis/dss/etl/HCSImageDatasetLoaderFactory.java | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/HCSImageDatasetLoaderFactory.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/HCSImageDatasetLoaderFactory.java
index 377af6ae13d..33e1a0d7624 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/HCSImageDatasetLoaderFactory.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/etl/HCSImageDatasetLoaderFactory.java
@@ -20,11 +20,8 @@ import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
-
-
 import ch.systemsx.cisd.openbis.dss.etl.dataaccess.HCSImageDatasetLoader;
 import ch.systemsx.cisd.openbis.dss.shared.DssScreeningUtils;
-import ch.systemsx.cisd.openbis.plugin.screening.shared.imaging.dataaccess.IImagingQueryDAO;
 
 /**
  * @author Tomasz Pylak
@@ -34,8 +31,6 @@ public class HCSImageDatasetLoaderFactory
     private static final Map<String, IContentRepositoryFactory> repositoryFactories =
             createFactories();
 
-    private static final IImagingQueryDAO query = DssScreeningUtils.createQuery();
-
     private static Map<String, IContentRepositoryFactory> createFactories()
     {
         Map<String, IContentRepositoryFactory> factories =
@@ -52,7 +47,7 @@ public class HCSImageDatasetLoaderFactory
     private static HCSImageDatasetLoader createImageDBLoader(File datasetRootDir, String datasetCode)
     {
         IContentRepository repository = new ContentRepository(datasetRootDir, repositoryFactories);
-        return new HCSImageDatasetLoader(query, datasetCode, repository);
+        return new HCSImageDatasetLoader(DssScreeningUtils.createQuery(), datasetCode, repository);
     }
 
 }
-- 
GitLab