Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2012-01-26 14:40:40 -0500
committerMartin Taal2012-01-26 14:40:40 -0500
commitdb0acb996d03ff9b75c3e074aac40968801e1b25 (patch)
tree994fa68c45a9123228095240aec3e5de945513e5
parent8af70034d898742ed2b0764abf559e3a93f15cfa (diff)
downloadcdo-db0acb996d03ff9b75c3e074aac40968801e1b25.tar.gz
cdo-db0acb996d03ff9b75c3e074aac40968801e1b25.tar.xz
cdo-db0acb996d03ff9b75c3e074aac40968801e1b25.zip
Fixes issue [369859] - [hibernate] large commits lead to timeout excetions
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
index 3f0a10b00d..ecf2409896 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java
@@ -53,6 +53,7 @@ import org.eclipse.net4j.util.collection.Pair;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
+import org.eclipse.net4j.util.om.monitor.OMMonitor.Async;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.ecore.EClass;
@@ -642,13 +643,16 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
{
// NOTE: the same flow is also present in the super class (StoreAccessor)
// changes in flow can mean that the flow here also has to change
-
+ monitor.begin(3);
HibernateThreadContext.setCommitContext(context);
if (context.getNewPackageUnits().length > 0)
{
- writePackageUnits(context.getNewPackageUnits(), monitor);
+ writePackageUnits(context.getNewPackageUnits(), monitor.fork());
}
+ // Note: instead of an Async here, we could do much more fine-grained monitoring below. But this
+ // simplistic solution is sufficient to prevent timeout errors.
+ final Async async = monitor.forkAsync();
try
{
// start with fresh hibernate session to prevent side effects
@@ -755,8 +759,13 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
OM.LOG.error(e);
throw WrappedException.wrap(e);
}
+ finally
+ {
+ async.stop();
+ }
- context.applyIDMappings(monitor);
+ context.applyIDMappings(monitor.fork());
+ monitor.done();
}
private void repairContainerIDs(List<InternalCDORevision> repairContainerIDs, Session session)

Back to the top