summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgidijus Vaisnora2012-01-05 11:18:09 (EST)
committerEgidijus Vaisnora2012-01-05 11:18:09 (EST)
commitcf524f68156a5172a1c0436cde560b5e5ab31d9c (patch)
tree0ea533c81ec8a0f2e38030e2bc2a028f709b4c33
parent4e1ba595bab91ce57475455e513399fcd42d6e16 (diff)
downloadcdo-cf524f68156a5172a1c0436cde560b5e5ab31d9c.zip
cdo-cf524f68156a5172a1c0436cde560b5e5ab31d9c.tar.gz
cdo-cf524f68156a5172a1c0436cde560b5e5ab31d9c.tar.bz2
Introduced server side checking for stale revision
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/.settings/.api_filters696
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingCommitContext.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java48
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/ReplicatorCommitContext.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_350120_Test.java58
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java2
15 files changed, 486 insertions, 392 deletions
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java
index e7ce43c..f24f713 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java
@@ -193,11 +193,10 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com
boolean ensuringReferentialIntegrity = getSession().getRepositoryInfo().isEnsuringReferentialIntegrity();
for (CDOIDAndVersion detachedObject : detachedObjects)
{
- CDOID id = detachedObject.getID();
- out.writeCDOID(id);
+ out.writeCDOIDAndVersion(detachedObject);
if (ensuringReferentialIntegrity)
{
- EClass eClass = getObjectType(id);
+ EClass eClass = getObjectType(detachedObject.getID());
out.writeCDOClassifierRef(eClass);
}
}
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 b647ccc..45d4833 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
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.common.id.CDOIDTemp;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.lob.CDOLobHandler;
import org.eclipse.emf.cdo.common.model.CDOClassifierRef;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionCacheAdder;
import org.eclipse.emf.cdo.common.revision.CDORevisionData;
@@ -694,11 +695,11 @@ public class HibernateStoreAccessor extends StoreAccessor implements IHibernateS
session.flush();
// delete all objects
- for (CDOID id : context.getDetachedObjects())
+ for (CDOIDAndVersion idAndVersion : context.getDetachedObjects())
{
try
{
- final CDORevision revision = HibernateUtil.getInstance().getCDORevision(id);
+ final CDORevision revision = HibernateUtil.getInstance().getCDORevision(idAndVersion.getID());
// maybe deleted in parallell?
if (revision != null)
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
index e1028c5..94ea439 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/Commits.java
@@ -24,6 +24,7 @@ import org.eclipse.emf.cdo.common.model.CDOModelUtil;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.model.CDOType;
import org.eclipse.emf.cdo.common.model.EMFUtil;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevisionCacheAdder;
import org.eclipse.emf.cdo.common.revision.CDORevisionData;
@@ -530,9 +531,9 @@ public class Commits extends Coll
private boolean isBeingDetached(InternalCommitContext context, CDOID id)
{
- for (CDOID idBeingDetached : context.getDetachedObjects())
+ for (CDOIDAndVersion idBeingDetached : context.getDetachedObjects())
{
- if (id.equals(idBeingDetached))
+ if (id.equals(idBeingDetached.getID()))
{
return true;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
index 801811d..3d76e3a 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.server.internal.net4j.bundle.OM;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
@@ -124,7 +125,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
CDOLockState[] locksOnNewObjects = new CDOLockState[in.readInt()];
InternalCDORevision[] newObjects = new InternalCDORevision[in.readInt()];
InternalCDORevisionDelta[] dirtyObjectDeltas = new InternalCDORevisionDelta[in.readInt()];
- CDOID[] detachedObjects = new CDOID[in.readInt()];
+ CDOIDAndVersion[] detachedObjects = new CDOIDAndVersion[in.readInt()];
monitor.begin(newPackageUnits.length + newObjects.length + dirtyObjectDeltas.length + detachedObjects.length);
try
@@ -201,13 +202,13 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
for (int i = 0; i < detachedObjects.length; i++)
{
- CDOID id = in.readCDOID();
+ CDOIDAndVersion id = in.readCDOIDAndVersion();
detachedObjects[i] = id;
if (detachedObjectTypes != null)
{
EClass eClass = (EClass)in.readCDOClassifierRefAndResolve();
- detachedObjectTypes.put(id, eClass);
+ detachedObjectTypes.put(id.getID(), eClass);
}
monitor.worked();
diff --git a/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
index f680b1e..566846b 100644
--- a/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
@@ -1,340 +1,356 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.emf.cdo.server" version="2">
- <resource path="src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java" type="org.eclipse.emf.cdo.internal.server.DelegatingRepository">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="InternalRepository"/>
- <message_argument value="CDOCommonRepository"/>
- <message_argument value="DelegatingRepository"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/LockingManager.java" type="org.eclipse.emf.cdo.internal.server.LockingManager$DurableView">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="Options"/>
- <message_argument value="DurableView"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="IView"/>
- <message_argument value="CDOCommonView"/>
- <message_argument value="DurableView"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/QueryManager.java" type="org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="IQueryContext"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/Repository.java" type="org.eclipse.emf.cdo.internal.server.Repository">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOReplicationInfo"/>
- <message_argument value="Repository"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="InternalRepository"/>
- <message_argument value="CDOCommonRepository"/>
- <message_argument value="Repository"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/ResourcesQueryHandler.java" type="org.eclipse.emf.cdo.internal.server.ResourcesQueryHandler$QueryContext">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="QueryResourcesContext"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java" type="org.eclipse.emf.cdo.internal.server.ServerCDOView">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="Options"/>
- <message_argument value="ServerCDOView"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java" type="org.eclipse.emf.cdo.internal.server.ServerCDOView$ServerCDOSession">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDORepositoryInfo"/>
- <message_argument value="ServerCDOSession"/>
- </message_arguments>
- </filter>
- <filter id="574619656">
- <message_arguments>
- <message_argument value="InternalCDOSession"/>
- <message_argument value="ServerCDOSession"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/Session.java" type="org.eclipse.emf.cdo.internal.server.Session">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="InternalSession"/>
- <message_argument value="CDOCommonSession"/>
- <message_argument value="Session"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java" type="org.eclipse.emf.cdo.internal.server.TransactionCommitContext$DeltaLockWrapper">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOIDAndBranch"/>
- <message_argument value="DeltaLockWrapper"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java" type="org.eclipse.emf.cdo.internal.server.TransactionCommitContext$XRefContext">
- <filter id="572522506">
- <message_arguments>
- <message_argument value="CDOIDReference"/>
- <message_argument value="XRefContext"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="QueryXRefsContext"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="XRefContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/View.java" type="org.eclipse.emf.cdo.internal.server.View">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="Options"/>
- <message_argument value="View"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="InternalView"/>
- <message_argument value="CDOCommonView"/>
- <message_argument value="View"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/XRefsQueryHandler.java" type="org.eclipse.emf.cdo.internal.server.XRefsQueryHandler$QueryContext">
- <filter id="572522506">
- <message_arguments>
- <message_argument value="CDOIDReference"/>
- <message_argument value="QueryContext"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="QueryXRefsContext"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedClientSessionConfiguration$RepositoryInfo">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDORepositoryInfo"/>
- <message_argument value="RepositoryInfo"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedClientSessionProtocol">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOSessionProtocol"/>
- <message_argument value="EmbeddedClientSessionProtocol"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedServerSessionProtocol">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="ISessionProtocol"/>
- <message_argument value="CDOProtocol"/>
- <message_argument value="EmbeddedServerSessionProtocol"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java" type="org.eclipse.emf.cdo.internal.server.mem.MEMStore">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="DurableLocking"/>
- <message_argument value="IDurableLockingManager"/>
- <message_argument value="MEMStore"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java" type="org.eclipse.emf.cdo.internal.server.mem.MEMStoreAccessor">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="DurableLocking"/>
- <message_argument value="IDurableLockingManager"/>
- <message_argument value="MEMStoreAccessor"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java" type="org.eclipse.emf.cdo.internal.server.syncing.OfflineClone$CommitContextData">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOCommitData"/>
- <message_argument value="CommitContextData"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java" type="org.eclipse.emf.cdo.internal.server.syncing.SynchronizableRepository$CommitContextData">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOCommitData"/>
- <message_argument value="CommitContextData"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java" type="org.eclipse.emf.cdo.internal.server.syncing.SynchronizableRepository$WriteThroughCommitContext">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="InternalCDOCommitContext"/>
- <message_argument value="WriteThroughCommitContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IQueryContext.java" type="org.eclipse.emf.cdo.server.IQueryContext">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="IQueryContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IRepository.java" type="org.eclipse.emf.cdo.server.IRepository">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOCommonRepository"/>
- <message_argument value="IRepository"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/ISession.java" type="org.eclipse.emf.cdo.server.ISession">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOCommonSession"/>
- <message_argument value="ISession"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$DurableLocking">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="IDurableLockingManager"/>
- <message_argument value="DurableLocking"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$QueryResourcesContext">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryResourcesContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$QueryXRefsContext">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryXRefsContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/ITransaction.java" type="org.eclipse.emf.cdo.server.ITransaction">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOCommonTransaction"/>
- <message_argument value="ITransaction"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IView.java" type="org.eclipse.emf.cdo.server.IView">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOCommonView"/>
- <message_argument value="IView"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/embedded/CDOSession.java" type="org.eclipse.emf.cdo.server.embedded.CDOSession">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOSession"/>
- <message_argument value="CDOSession"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/embedded/CDOSessionConfiguration.java" type="org.eclipse.emf.cdo.server.embedded.CDOSessionConfiguration">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOSessionConfiguration"/>
- <message_argument value="CDOSessionConfiguration"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/DurableLockArea.java" type="org.eclipse.emf.cdo.spi.server.DurableLockArea">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="LockArea"/>
- <message_argument value="DurableLockArea"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java" type="org.eclipse.emf.cdo.spi.server.ISessionProtocol">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOProtocol"/>
- <message_argument value="ISessionProtocol"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java" type="org.eclipse.emf.cdo.spi.server.InternalLockManager">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="IDurableLockingManager"/>
- <message_argument value="InternalLockManager"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/InternalSession.java" type="org.eclipse.emf.cdo.spi.server.InternalSession">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="Options"/>
- <message_argument value="InternalSession"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/InternalSynchronizableRepository.java" type="org.eclipse.emf.cdo.spi.server.InternalSynchronizableRepository">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOReplicationContext"/>
- <message_argument value="InternalSynchronizableRepository"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/Store.java" type="org.eclipse.emf.cdo.spi.server.Store">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="ExactMatch"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="Store"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.emf.cdo.server" version="2">
+ <resource path="src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java" type="org.eclipse.emf.cdo.internal.server.DelegatingRepository">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="InternalRepository"/>
+ <message_argument value="CDOCommonRepository"/>
+ <message_argument value="DelegatingRepository"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/LockingManager.java" type="org.eclipse.emf.cdo.internal.server.LockingManager$DurableView">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="DurableView"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="IView"/>
+ <message_argument value="CDOCommonView"/>
+ <message_argument value="DurableView"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/QueryManager.java" type="org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="IQueryContext"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/Repository.java" type="org.eclipse.emf.cdo.internal.server.Repository">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOReplicationInfo"/>
+ <message_argument value="Repository"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="InternalRepository"/>
+ <message_argument value="CDOCommonRepository"/>
+ <message_argument value="Repository"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/ResourcesQueryHandler.java" type="org.eclipse.emf.cdo.internal.server.ResourcesQueryHandler$QueryContext">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="QueryResourcesContext"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java" type="org.eclipse.emf.cdo.internal.server.ServerCDOView">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="ServerCDOView"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java" type="org.eclipse.emf.cdo.internal.server.ServerCDOView$ServerCDOSession">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDORepositoryInfo"/>
+ <message_argument value="ServerCDOSession"/>
+ </message_arguments>
+ </filter>
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="InternalCDOSession"/>
+ <message_argument value="ServerCDOSession"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/Session.java" type="org.eclipse.emf.cdo.internal.server.Session">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="InternalSession"/>
+ <message_argument value="CDOCommonSession"/>
+ <message_argument value="Session"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java" type="org.eclipse.emf.cdo.internal.server.TransactionCommitContext$DeltaLockWrapper">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOIDAndBranch"/>
+ <message_argument value="DeltaLockWrapper"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java" type="org.eclipse.emf.cdo.internal.server.TransactionCommitContext$XRefContext">
+ <filter id="572522506">
+ <message_arguments>
+ <message_argument value="CDOIDReference"/>
+ <message_argument value="XRefContext"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="QueryXRefsContext"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="XRefContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/View.java" type="org.eclipse.emf.cdo.internal.server.View">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="View"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="InternalView"/>
+ <message_argument value="CDOCommonView"/>
+ <message_argument value="View"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/XRefsQueryHandler.java" type="org.eclipse.emf.cdo.internal.server.XRefsQueryHandler$QueryContext">
+ <filter id="572522506">
+ <message_arguments>
+ <message_argument value="CDOIDReference"/>
+ <message_argument value="QueryContext"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="QueryXRefsContext"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedClientSessionConfiguration$RepositoryInfo">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDORepositoryInfo"/>
+ <message_argument value="RepositoryInfo"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedClientSessionProtocol">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOSessionProtocol"/>
+ <message_argument value="EmbeddedClientSessionProtocol"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedServerSessionProtocol">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="ISessionProtocol"/>
+ <message_argument value="CDOProtocol"/>
+ <message_argument value="EmbeddedServerSessionProtocol"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java" type="org.eclipse.emf.cdo.internal.server.mem.MEMStore">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="DurableLocking"/>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="MEMStore"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java" type="org.eclipse.emf.cdo.internal.server.mem.MEMStoreAccessor">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="DurableLocking"/>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="MEMStoreAccessor"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java" type="org.eclipse.emf.cdo.internal.server.syncing.OfflineClone$CommitContextData">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOCommitData"/>
+ <message_argument value="CommitContextData"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java" type="org.eclipse.emf.cdo.internal.server.syncing.SynchronizableRepository$CommitContextData">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOCommitData"/>
+ <message_argument value="CommitContextData"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java" type="org.eclipse.emf.cdo.internal.server.syncing.SynchronizableRepository$WriteThroughCommitContext">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="InternalCDOCommitContext"/>
+ <message_argument value="WriteThroughCommitContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IQueryContext.java" type="org.eclipse.emf.cdo.server.IQueryContext">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="IQueryContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IRepository.java" type="org.eclipse.emf.cdo.server.IRepository">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOCommonRepository"/>
+ <message_argument value="IRepository"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/ISession.java" type="org.eclipse.emf.cdo.server.ISession">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOCommonSession"/>
+ <message_argument value="ISession"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$CommitContext">
+ <filter id="405901410">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.cdo.server.IStoreAccessor.CommitContext"/>
+ <message_argument value="getDetachedObjects()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$DurableLocking">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="DurableLocking"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$QueryResourcesContext">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryResourcesContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$QueryXRefsContext">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryXRefsContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/ITransaction.java" type="org.eclipse.emf.cdo.server.ITransaction">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOCommonTransaction"/>
+ <message_argument value="ITransaction"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IView.java" type="org.eclipse.emf.cdo.server.IView">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOCommonView"/>
+ <message_argument value="IView"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/embedded/CDOSession.java" type="org.eclipse.emf.cdo.server.embedded.CDOSession">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOSession"/>
+ <message_argument value="CDOSession"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/embedded/CDOSessionConfiguration.java" type="org.eclipse.emf.cdo.server.embedded.CDOSessionConfiguration">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOSessionConfiguration"/>
+ <message_argument value="CDOSessionConfiguration"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/DurableLockArea.java" type="org.eclipse.emf.cdo.spi.server.DurableLockArea">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="LockArea"/>
+ <message_argument value="DurableLockArea"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java" type="org.eclipse.emf.cdo.spi.server.ISessionProtocol">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOProtocol"/>
+ <message_argument value="ISessionProtocol"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java" type="org.eclipse.emf.cdo.spi.server.InternalCommitContext">
+ <filter id="405901410">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.cdo.spi.server.InternalCommitContext"/>
+ <message_argument value="setDetachedObjects(CDOID[])"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java" type="org.eclipse.emf.cdo.spi.server.InternalLockManager">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="InternalLockManager"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/InternalSession.java" type="org.eclipse.emf.cdo.spi.server.InternalSession">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="InternalSession"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/InternalSynchronizableRepository.java" type="org.eclipse.emf.cdo.spi.server.InternalSynchronizableRepository">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOReplicationContext"/>
+ <message_argument value="InternalSynchronizableRepository"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/Store.java" type="org.eclipse.emf.cdo.spi.server.Store">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="ExactMatch"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="Store"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingCommitContext.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingCommitContext.java
index 8dcee72..af0cb2f 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingCommitContext.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.server.IStoreAccessor;
import org.eclipse.emf.cdo.server.IStoreAccessor.CommitContext;
@@ -82,7 +83,7 @@ public abstract class DelegatingCommitContext implements IStoreAccessor.CommitCo
return getDelegate().getDirtyObjectDeltas();
}
- public CDOID[] getDetachedObjects()
+ public CDOIDAndVersion[] getDetachedObjects()
{
return getDelegate().getDetachedObjects();
}
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 077bbbc..ae6aaa4 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
@@ -135,7 +135,7 @@ public class TransactionCommitContext implements InternalCommitContext
private InternalCDORevisionDelta[] dirtyObjectDeltas = new InternalCDORevisionDelta[0];
- private CDOID[] detachedObjects = new CDOID[0];
+ private CDOIDAndVersion[] detachedObjects = new CDOIDAndVersion[0];
private Map<CDOID, EClass> detachedObjectTypes;
@@ -239,7 +239,7 @@ public class TransactionCommitContext implements InternalCommitContext
return dirtyObjects;
}
- public CDOID[] getDetachedObjects()
+ public CDOIDAndVersion[] getDetachedObjects()
{
return detachedObjects;
}
@@ -316,7 +316,7 @@ public class TransactionCommitContext implements InternalCommitContext
{
for (int i = 0; i < detachedObjects.length; i++)
{
- cache.put(detachedObjects[i], DETACHED);
+ cache.put(detachedObjects[i].getID(), DETACHED);
}
}
@@ -404,7 +404,7 @@ public class TransactionCommitContext implements InternalCommitContext
this.dirtyObjectDeltas = dirtyObjectDeltas;
}
- public void setDetachedObjects(CDOID[] detachedObjects)
+ public void setDetachedObjects(CDOIDAndVersion[] detachedObjects)
{
this.detachedObjects = detachedObjects;
}
@@ -679,7 +679,7 @@ public class TransactionCommitContext implements InternalCommitContext
return cachedDetachedRevisions[i];
}
- return CDOIDUtil.createIDAndVersion(detachedObjects[i], CDORevision.UNSPECIFIED_VERSION);
+ return detachedObjects[i];
}
@Override
@@ -790,7 +790,7 @@ public class TransactionCommitContext implements InternalCommitContext
for (int i = 0; i < detachedObjects.length; i++)
{
- CDOID id = detachedObjects[i];
+ CDOID id = detachedObjects[i].getID();
Object key = lockManager.getLockKey(id, transaction.getBranch());
lockedObjects.add(key);
}
@@ -987,11 +987,7 @@ public class TransactionCommitContext implements InternalCommitContext
}
CDOBranch branch = transaction.getBranch();
- if (ObjectUtil.equals(oldRevision.getBranch(), branch) && oldRevision.isHistorical())
- {
- throw new ConcurrentModificationException("Attempt by " + transaction + " to modify historical revision: "
- + oldRevision);
- }
+ checkForStaleRevision(oldRevision, branch);
// Make sure all chunks are loaded
for (EStructuralFeature feature : CDOModelUtil.getAllPersistentFeatures(oldRevision.getEClass()))
@@ -1009,6 +1005,15 @@ public class TransactionCommitContext implements InternalCommitContext
return newRevision;
}
+ private void checkForStaleRevision(InternalCDORevision oldRevision, CDOBranch branch)
+ {
+ if (ObjectUtil.equals(oldRevision.getBranch(), branch) && oldRevision.isHistorical())
+ {
+ throw new ConcurrentModificationException("Attempt by " + transaction + " to modify historical revision: "
+ + oldRevision);
+ }
+ }
+
private void applyIDMappings(InternalCDORevision[] revisions, OMMonitor monitor)
{
try
@@ -1216,15 +1221,26 @@ public class TransactionCommitContext implements InternalCommitContext
int size = detachedObjects.length;
cachedDetachedRevisions = new InternalCDORevision[size];
- CDOID[] detachedObjects = getDetachedObjects();
+ CDOIDAndVersion[] detachedObjects = getDetachedObjects();
try
{
monitor.begin(size);
for (int i = 0; i < size; i++)
{
- CDOID id = detachedObjects[i];
-
+ CDOID id = detachedObjects[i].getID();
+ CDOBranch branch = transaction.getBranch();
+ InternalCDORevision oldRevision = revisionManager.getRevisionByVersion(id,
+ branch.getVersion(detachedObjects[i].getVersion()), CDORevision.UNCHUNKED, true);
+
+ /*
+ * why oldRevision is null, even if it is present in the revision cache? Because it is PointerCDORevision and
+ * it's method getVersion gives UNSPECIFIED_VERSION
+ */
+ if (oldRevision != null)
+ {
+ checkForStaleRevision(oldRevision, branch);
+ }
// Remember the cached revision that must be revised after successful commit through updateInfraStructure
cachedDetachedRevisions[i] = (InternalCDORevision)revisionManager.getCache().getRevision(id, transaction);
monitor.worked();
@@ -1360,9 +1376,9 @@ public class TransactionCommitContext implements InternalCommitContext
{
XRefsQueryHandler.collectSourceCandidates(transaction, detachedObjectTypes.values(), sourceCandidates);
- for (CDOID id : detachedObjects)
+ for (CDOIDAndVersion id : detachedObjects)
{
- detachedIDs.add(id);
+ detachedIDs.add(id.getID());
}
for (InternalCDORevision revision : dirtyObjects)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
index 6a5b082..613e08e 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
@@ -459,7 +459,7 @@ public class EmbeddedClientSessionProtocol extends Lifecycle implements CDOSessi
serverCommitContext.setDirtyObjectDeltas(rd.toArray(new InternalCDORevisionDelta[rd.size()]));
List<CDOIDAndVersion> detachedObjects = commitData.getDetachedObjects();
- serverCommitContext.setDetachedObjects(detachedObjects.toArray(new CDOID[detachedObjects.size()]));
+ serverCommitContext.setDetachedObjects(detachedObjects.toArray(new CDOIDAndVersion[detachedObjects.size()]));
serverCommitContext.write(monitor.fork());
success = serverCommitContext.getRollbackMessage() == null;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/ReplicatorCommitContext.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/ReplicatorCommitContext.java
index dce98eb..5c0666b 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/ReplicatorCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/ReplicatorCommitContext.java
@@ -12,7 +12,6 @@ package org.eclipse.emf.cdo.internal.server.syncing;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
-import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
@@ -53,7 +52,7 @@ public final class ReplicatorCommitContext extends TransactionCommitContext
InternalCDORevisionDelta[] dirtyObjectDeltas = getDirtyObjectDeltas(commitInfo);
setDirtyObjectDeltas(dirtyObjectDeltas);
- CDOID[] detachedObjects = getDetachedObjects(commitInfo);
+ CDOIDAndVersion[] detachedObjects = getDetachedObjects(commitInfo);
setDetachedObjects(detachedObjects);
}
@@ -155,17 +154,9 @@ public final class ReplicatorCommitContext extends TransactionCommitContext
return result;
}
- private static CDOID[] getDetachedObjects(CDOCommitInfo commitInfo)
+ private static CDOIDAndVersion[] getDetachedObjects(CDOCommitInfo commitInfo)
{
List<CDOIDAndVersion> list = commitInfo.getDetachedObjects();
- CDOID[] result = new CDOID[list.size()];
-
- int i = 0;
- for (CDOIDAndVersion key : list)
- {
- result[i++] = key.getID();
- }
-
- return result;
+ return list.toArray(new CDOIDAndVersion[list.size()]);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
index c459718..da59fa7 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
@@ -15,14 +15,12 @@ import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
-import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
import org.eclipse.emf.cdo.common.commit.CDOChangeKind;
import org.eclipse.emf.cdo.common.commit.CDOChangeSetData;
import org.eclipse.emf.cdo.common.commit.CDOCommitData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoHandler;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.lob.CDOLob;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo.Operation;
@@ -799,13 +797,13 @@ public abstract class SynchronizableRepository extends Repository.Default implem
public List<CDOIDAndVersion> getDetachedObjects()
{
- final CDOID[] detachedObjects = commitContext.getDetachedObjects();
+ final CDOIDAndVersion[] detachedObjects = commitContext.getDetachedObjects();
return new IndexedList<CDOIDAndVersion>()
{
@Override
public CDOIDAndVersion get(int index)
{
- return CDOIDUtil.createIDAndVersion(detachedObjects[index], CDOBranchVersion.UNSPECIFIED_VERSION);
+ return detachedObjects[index];
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java
index ed6dd8f..729df5a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java
@@ -26,6 +26,7 @@ import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionCacheAdder;
import org.eclipse.emf.cdo.common.revision.CDORevisionHandler;
@@ -354,9 +355,9 @@ public interface IStoreAccessor extends IQueryHandlerProvider, BranchLoader, Com
* Returns an array of the removed object that are part of the commit operation represented by this
* <code>CommitContext</code>.
*
- * @since 2.0
+ * @since 4.1
*/
- public CDOID[] getDetachedObjects();
+ public CDOIDAndVersion[] getDetachedObjects();
/**
* Returns a map with an {@link EClass} value per {@link CDOID} type.
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java
index 38965dc..27fa0f1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.cdo.spi.server;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockState;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.server.IStoreAccessor;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
@@ -87,7 +88,10 @@ public interface InternalCommitContext extends IStoreAccessor.CommitContext
public void setDirtyObjectDeltas(InternalCDORevisionDelta[] dirtyObjectDeltas);
- public void setDetachedObjects(CDOID[] detachedObjects);
+ /**
+ * @since 4.1
+ */
+ public void setDetachedObjects(CDOIDAndVersion[] detachedObjects);
/**
* @since 4.0
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java
index 5c15749..7d13ad4 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/StoreAccessor.java
@@ -15,6 +15,7 @@ package org.eclipse.emf.cdo.spi.server;
import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IStore;
import org.eclipse.emf.cdo.server.ITransaction;
@@ -64,12 +65,18 @@ public abstract class StoreAccessor extends StoreAccessorBase
InternalCDOPackageUnit[] newPackageUnits = context.getNewPackageUnits();
InternalCDORevision[] newObjects = context.getNewObjects();
- CDOID[] detachedObjects = context.getDetachedObjects();
+ CDOIDAndVersion[] detachedObjects = context.getDetachedObjects();
+ CDOID[] detachedObjectsIDs = new CDOID[detachedObjects.length];
+ for (int i = 0; i < detachedObjects.length; i++)
+ {
+ detachedObjectsIDs[i] = detachedObjects[i].getID();
+ }
+
int dirtyCount = deltas ? context.getDirtyObjectDeltas().length : context.getDirtyObjects().length;
try
{
- monitor.begin(1 + newPackageUnits.length + 2 + newObjects.length + detachedObjects.length + dirtyCount);
+ monitor.begin(1 + newPackageUnits.length + 2 + newObjects.length + detachedObjectsIDs.length + dirtyCount);
writeCommitInfo(branch, timeStamp, previousTimeStamp, userID, commitComment, monitor.fork());
if (newPackageUnits.length != 0)
@@ -84,9 +91,9 @@ public abstract class StoreAccessor extends StoreAccessorBase
applyIDMappings(context, monitor);
- if (detachedObjects.length != 0)
+ if (detachedObjectsIDs.length != 0)
{
- detachObjects(detachedObjects, branch, timeStamp, monitor.fork(detachedObjects.length));
+ detachObjects(detachedObjectsIDs, branch, timeStamp, monitor.fork(detachedObjectsIDs.length));
}
if (newObjects.length != 0)
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_350120_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_350120_Test.java
index e8d9f7e..356b5af 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_350120_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_350120_Test.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.net4j.CDONet4jSession;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
import org.eclipse.emf.cdo.tests.model1.Category;
@@ -32,6 +33,62 @@ import java.util.List;
*/
public class Bugzilla_350120_Test extends AbstractCDOTest
{
+
+ private static final String EXPECTED_TO_RECEIVE_JAVA_UTIL_CONCURRENT_MODIFICATION_EXCEPTION = "Expected to receive ConcurrentModificationException or IllegalStateException";
+
+ public void testNewerVersionOnServer() throws CommitException
+ {
+ CDOSession user1Session = openSession();
+ user1Session.options().setPassiveUpdateEnabled(false);
+
+ CDOTransaction user1Transaction = user1Session.openTransaction();
+ CDOResource createResource = user1Transaction.createResource(getResourcePath("test"));
+ Category user1RootCategory = getModel1Factory().createCategory();
+ createResource.getContents().add(user1RootCategory);
+ user1Transaction.commit();
+
+ // User 2
+ CDONet4jSession user2Session = (CDONet4jSession)openSession();
+ user2Session.options().setPassiveUpdateEnabled(false);
+ CDOTransaction user2Transaction = user2Session.openTransaction();
+ CDOObject user2RootCategory = user2Transaction.getObject(CDOUtil.getCDOObject(user1RootCategory).cdoID());
+
+ // User 1
+ Category user1ChildCategory = getModel1Factory().createCategory();
+ user1RootCategory.getCategories().add(user1ChildCategory);
+ user1Transaction.commit();
+
+ // User 2
+ EcoreUtil.delete(user2RootCategory);
+ try
+ {
+ user2Transaction.commit();
+ fail(EXPECTED_TO_RECEIVE_JAVA_UTIL_CONCURRENT_MODIFICATION_EXCEPTION);
+ }
+ catch (CommitException e)
+ {
+ boolean success = false;
+ String message = e.getMessage();
+ int index = message.indexOf('\n');
+ if (index != -1)
+ {
+ String substring = message.substring(0, index);
+ success = substring.contains("java.util.ConcurrentModificationException");
+ if (!success)
+ {
+ // for non audit repository not concurrent modification exception is thrown
+ success = substring.contains("java.lang.IllegalStateException");
+ }
+ }
+
+ if (!success)
+ {
+ // EXPECTED_TO_RECEIVE_JAVA_UTIL_CONCURRENT_MODIFICATION_EXCEPTION
+ throw e;
+ }
+ }
+ }
+
public void testConflict() throws CommitException
{
CDOSession user1Session = openSession();
@@ -162,4 +219,5 @@ public class Bugzilla_350120_Test extends AbstractCDOTest
user2Session.close();
user1Session.close();
}
+
}
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 42de90f..e628aab 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
@@ -2548,7 +2548,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
// Add "version-less" key.
// CDOSessionImpl.reviseRevisions() will call reviseLatest() accordingly.
- detached.add(CDOIDUtil.createIDAndVersion(id, CDOBranchVersion.UNSPECIFIED_VERSION));
+ detached.add(CDOIDUtil.createIDAndVersion(id, getCleanRevisions().get(detachedObjects.get(id)).getVersion()));
}
dirtyObjects = filterCommittables(transaction.getDirtyObjects());