[Dive4elements-commits] [PATCH 2 of 2] merged
Wald Commits
scm-commit at wald.intevation.org
Mon Apr 8 14:54:38 CEST 2013
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1365425672 -7200
# Node ID e4a59c795ff6d7218a9971e8cafe9bc1d41e90eb
# Parent 55d6c5cac9d18e6fb1a75b5c892e19e614ae1daf
# Parent b75005269a6cb48e1e81b5afe71ea5ab6357aebe
merged.
diff -r 55d6c5cac9d1 -r e4a59c795ff6 flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/Recommendations.java
--- 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(
More information about the Dive4elements-commits
mailing list