Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-08-03 06:45:48 +0000
committerEike Stepper2012-08-03 06:45:48 +0000
commit92ec4a1b4221f0f72f0324e3971e2e4370a228ce (patch)
tree1c0d63efc7916eaa2200ff8ed08c1c810abf3b23 /plugins/org.eclipse.emf.cdo
parent6c3bd148de137109075e86eeb962138647ab104c (diff)
downloadcdo-92ec4a1b4221f0f72f0324e3971e2e4370a228ce.tar.gz
cdo-92ec4a1b4221f0f72f0324e3971e2e4370a228ce.tar.xz
cdo-92ec4a1b4221f0f72f0324e3971e2e4370a228ce.zip
[386536] Transmit detached versions during commit
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386536
Diffstat (limited to 'plugins/org.eclipse.emf.cdo')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java11
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java18
4 files changed, 23 insertions, 25 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index 708f06e23f..2ff84f65b5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -1009,16 +1009,7 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme
for (CDOIDAndVersion key : commitInfo.getDetachedObjects())
{
CDOID id = key.getID();
- int version = key.getVersion();
- if (version == CDOBranchVersion.UNSPECIFIED_VERSION)
- {
- revisionManager.reviseLatest(id, newBranch);
- }
- else
- {
- CDOBranchVersion branchVersion = newBranch.getVersion(version);
- revisionManager.reviseVersion(id, branchVersion, timeStamp);
- }
+ revisionManager.reviseLatest(id, newBranch);
}
return oldRevisions;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
index 7f9227ef96..ba7d450656 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
@@ -65,11 +65,10 @@ public class CDOSingleTransactionStrategyImpl implements CDOTransactionStrategy
CDOCommitData commitData = commitContext.getCommitData();
InternalCDOSession session = transaction.getSession();
- CommitTransactionResult result = null;
OMMonitor monitor = new EclipseMonitor(progressMonitor);
CDOSessionProtocol sessionProtocol = session.getSessionProtocol();
- result = sessionProtocol.commitTransaction(commitContext, monitor);
+ CommitTransactionResult result = sessionProtocol.commitTransaction(commitContext, monitor);
commitContext.postCommit(result);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index a3d5499caf..3a76ff96bd 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -2623,11 +2623,19 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
detachedObjects = filterCommittables(transaction.getDetachedObjects());
List<CDOIDAndVersion> detached = new ArrayList<CDOIDAndVersion>(detachedObjects.size());
- for (CDOID id : detachedObjects.keySet())
+ for (Entry<CDOID, CDOObject> entry : detachedObjects.entrySet())
{
- // Add "version-less" key.
- // CDOSessionImpl.reviseRevisions() will call reviseLatest() accordingly.
- detached.add(CDOIDUtil.createIDAndVersion(id, CDOBranchVersion.UNSPECIFIED_VERSION));
+ CDOObject object = entry.getValue();
+ InternalCDORevision cleanRevision = cleanRevisions.get(object);
+
+ if (cleanRevision.getBranch() == getBranch())
+ {
+ detached.add(CDOIDUtil.createIDAndVersion(cleanRevision));
+ }
+ else
+ {
+ detached.add(cleanRevision);
+ }
}
dirtyObjects = filterCommittables(transaction.getDirtyObjects());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
index bb4bd3f63d..0e14ad26d6 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
@@ -780,6 +780,15 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
return newLockStates;
}
+ /**
+ * @since 4.1
+ */
+ public void setNewLockStates(CDOLockState[] newLockStates)
+ {
+ CheckUtil.checkArg(newLockStates, "newLockStates");
+ this.newLockStates = newLockStates;
+ }
+
protected PostCommitReferenceAdjuster createReferenceAdjuster()
{
return new PostCommitReferenceAdjuster(idProvider, new CDOIDMapper(idMappings));
@@ -818,15 +827,6 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
return idMapper.adjustReference(id, feature, index);
}
}
-
- /**
- * @since 4.1
- */
- public void setNewLockStates(CDOLockState[] newLockStates)
- {
- CheckUtil.checkArg(newLockStates, "newLockStates");
- this.newLockStates = newLockStates;
- }
}
/**

Back to the top