Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-05-30 14:09:18 -0400
committerEike Stepper2013-05-30 14:09:18 -0400
commitb95a129e0800f82512efb166628d8ae357b3c113 (patch)
tree3889780e49b1644cc82dbf79961339672ee2bb16
parent23b1b7dcd93da143bd4143cd4dc99e1f15b75713 (diff)
downloadcdo-b95a129e0800f82512efb166628d8ae357b3c113.tar.gz
cdo-b95a129e0800f82512efb166628d8ae357b3c113.tar.xz
cdo-b95a129e0800f82512efb166628d8ae357b3c113.zip
Enhance the way revisions are provided
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
index e8a7a3d566..ac21fd8521 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
@@ -59,6 +59,7 @@ import org.eclipse.emf.cdo.spi.common.revision.CDOIDMapper;
import org.eclipse.emf.cdo.spi.common.revision.CDOReferenceAdjuster;
import org.eclipse.emf.cdo.spi.common.revision.DetachedCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionCache;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionDelta;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
import org.eclipse.emf.cdo.spi.common.revision.StubCDORevision;
@@ -109,8 +110,6 @@ public class TransactionCommitContext implements InternalCommitContext
private InternalRepository repository;
- private InternalCDORevisionManager revisionManager;
-
private InternalLockManager lockManager;
private InternalCDOPackageRegistry repositoryPackageRegistry;
@@ -187,7 +186,6 @@ public class TransactionCommitContext implements InternalCommitContext
branch = transaction.getBranch();
repository = transaction.getRepository();
- revisionManager = repository.getRevisionManager();
lockManager = repository.getLockingManager();
serializingCommits = repository.isSerializingCommits();
ensuringReferentialIntegrity = repository.isEnsuringReferentialIntegrity();
@@ -901,9 +899,7 @@ public class TransactionCommitContext implements InternalCommitContext
{
for (CDOID id : lockedTargets)
{
- InternalCDORevision revision = //
- revisionManager.getRevision(id, transaction, CDORevision.UNCHUNKED, CDORevision.DEPTH_NONE, true);
-
+ CDORevision revision = transaction.getRevision(id);
if (revision == null || revision instanceof DetachedCDORevision)
{
throw new IllegalStateException("Object " + id
@@ -1103,10 +1099,10 @@ public class TransactionCommitContext implements InternalCommitContext
try
{
- oldRevision = revisionManager.getRevisionByVersion(id, delta, CDORevision.UNCHUNKED, true);
+ oldRevision = (InternalCDORevision)transaction.getRevision(id);
if (oldRevision != null)
{
- if (oldRevision.getBranch() == branch && oldRevision.isHistorical())
+ if (oldRevision.getBranch() != delta.getBranch() || oldRevision.getVersion() != delta.getVersion())
{
oldRevision = null;
}
@@ -1319,6 +1315,8 @@ public class TransactionCommitContext implements InternalCommitContext
try
{
monitor.begin(revisions.length);
+ InternalCDORevisionManager revisionManager = repository.getRevisionManager();
+
for (CDORevision revision : revisions)
{
if (revision != null)
@@ -1367,12 +1365,14 @@ public class TransactionCommitContext implements InternalCommitContext
try
{
monitor.begin(size);
+ InternalCDORevisionCache cache = repository.getRevisionManager().getCache();
+
for (int i = 0; i < size; i++)
{
CDOID id = detachedObjects[i];
// Remember the cached revision that must be revised after successful commit through updateInfraStructure
- cachedDetachedRevisions[i] = (InternalCDORevision)revisionManager.getCache().getRevision(id, transaction);
+ cachedDetachedRevisions[i] = (InternalCDORevision)cache.getRevision(id, transaction);
monitor.worked();
}
}

Back to the top