Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon McDuff2008-11-03 15:10:12 -0500
committerSimon McDuff2008-11-03 15:10:12 -0500
commitaac49607637484bcd3de42fa09393b2f896caa10 (patch)
tree211432e60d66b2f8582c6bbfb257d2d6587128ad
parent163840e930d67246bf4a178bdb524d80ce8e2fa8 (diff)
downloadcdo-aac49607637484bcd3de42fa09393b2f896caa10.tar.gz
cdo-aac49607637484bcd3de42fa09393b2f896caa10.tar.xz
cdo-aac49607637484bcd3de42fa09393b2f896caa10.zip
[249847] Store resources in a hierarchical structure
https://bugs.eclipse.org/bugs/show_bug.cgi?id=249847
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java12
1 files changed, 11 insertions, 1 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 0aeb4a9ed0..c4cf79d6ff 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
@@ -346,6 +346,7 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
@Override
public void write(CommitContext context)
{
+ List<InternalCDORevision> adjustRevisions = new ArrayList<InternalCDORevision>();
HibernateThreadContext.setCommitContext(context);
if (context.getNewPackages().length > 0)
{
@@ -362,7 +363,9 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
{
if (cdoRevision instanceof InternalCDORevision)
{
- ((InternalCDORevision)cdoRevision).setVersion(cdoRevision.getVersion() - 1);
+ InternalCDORevision internalCDORevision = (InternalCDORevision)cdoRevision;
+ internalCDORevision.setVersion(cdoRevision.getVersion() - 1);
+ adjustRevisions.add(internalCDORevision);
}
}
@@ -436,6 +439,13 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
OM.LOG.error(e);
throw WrappedException.wrap(e);
}
+ finally
+ {
+ for (InternalCDORevision cdoRevision : adjustRevisions)
+ {
+ cdoRevision.setVersion(cdoRevision.getVersion() + 1);
+ }
+ }
context.applyIDMappings();
}

Back to the top