Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Taal2012-01-26 19:30:44 +0000
committerMartin Taal2012-01-26 19:30:44 +0000
commit2778396f7fd2b8db981d9bd0acd901af53c81d7f (patch)
tree84efe49540d71b8d24ba517c521b7b187b333a23 /plugins/org.eclipse.emf.cdo.server.hibernate
parent44d00285cefe870985ea0bf2d546c44617ae7c90 (diff)
downloadcdo-2778396f7fd2b8db981d9bd0acd901af53c81d7f.tar.gz
cdo-2778396f7fd2b8db981d9bd0acd901af53c81d7f.tar.xz
cdo-2778396f7fd2b8db981d9bd0acd901af53c81d7f.zip
Fixes issue [369384] - [hibernate] large commits lead to timeout excetions
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.hibernate')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java14
1 files changed, 12 insertions, 2 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 6d7877dde3..7fdf5a3142 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;
@@ -643,12 +644,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 +760,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