changeset 5592:e4a59c795ff6

merged.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 08 Apr 2013 14:54:32 +0200
parents 55d6c5cac9d1 (current diff) b75005269a6c (diff)
children cf4cc385e7c6
files
diffstat 1 files changed, 22 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/Recommendations.java	Mon Apr 08 14:52:59 2013 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/Recommendations.java	Mon Apr 08 14:54:32 2013 +0200
@@ -20,6 +20,7 @@
 import org.w3c.dom.Node;
 
 import org.hibernate.Session;
+import org.hibernate.SessionFactory;
 
 import org.hibernate.jdbc.Work;
 
@@ -29,7 +30,7 @@
 
 import de.intevation.flys.artifacts.FLYSArtifact;
 
-import de.intevation.flys.backend.SedDBSessionHolder;
+import de.intevation.flys.backend.SessionFactoryProvider;
 import de.intevation.flys.backend.SessionHolder;
 
 import de.intevation.artifactdatabase.data.StateData;
@@ -218,26 +219,33 @@
                     (Connection)null);
             }
         });
-        /*
         systemSession.doWork(new Work() {
             @Override
             public void execute(final Connection systemConnection)
             throws SQLException
             {
-                SedDBSessionHolder.HOLDER.get().doWork(new Work() {
-                    @Override
-                    public void execute(Connection sedDBConnection)
-                    throws SQLException
-                    {
-                        recommend(
-                            parameters, userId, result,
-                            systemConnection,
-                            sedDBConnection);
-                    }
-                });
+                SessionFactory sedDBFactory =
+                    SessionFactoryProvider.getSedDBSessionFactory();
+
+                Session sedDBSession = sedDBFactory.openSession();
+                try {
+                    sedDBSession.doWork(new Work() {
+                        @Override
+                        public void execute(Connection sedDBConnection)
+                        throws SQLException
+                        {
+                            recommend(
+                                parameters, userId, result,
+                                systemConnection,
+                                sedDBConnection);
+                        }
+                    });
+                }
+                finally {
+                    sedDBSession.close();
+                }
             }
         });
-        */
     }
 
     public void recommend(

http://dive4elements.wald.intevation.org