Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-07-30 08:19:15 -0400
committerEike Stepper2016-07-30 08:19:38 -0400
commit6dc966a83269a207a5538850648ea23697c682bc (patch)
tree7cf7392277825440a53ca835ba593662729e70e0 /plugins/org.eclipse.emf.cdo.server.net4j
parentdaae9e913594dd5b8317bd26d7e778d6020a8d4d (diff)
downloadcdo-6dc966a83269a207a5538850648ea23697c682bc.tar.gz
cdo-6dc966a83269a207a5538850648ea23697c682bc.tar.xz
cdo-6dc966a83269a207a5538850648ea23697c682bc.zip
[$387563] $Generalize the "lock of new objects on commit" feature to the "lock/unlock objects on commit"
Task-Url: $https://bugs.eclipse.org/bugs/show_bug.cgi?id=387563
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.net4j')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java46
2 files changed, 34 insertions, 20 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF
index 048d55afcd..9254099351 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.server.net4j;singleton:=true
-Bundle-Version: 4.1.300.qualifier
+Bundle-Version: 4.1.400.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -12,6 +12,6 @@ Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.emf.cdo.server;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.server.internal.net4j.bundle;version="4.1.300";x-internal:=true,
- org.eclipse.emf.cdo.server.internal.net4j.protocol;version="4.1.300";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.server.net4j;version="4.1.300"
+Export-Package: org.eclipse.emf.cdo.server.internal.net4j.bundle;version="4.1.400";x-internal:=true,
+ org.eclipse.emf.cdo.server.internal.net4j.protocol;version="4.1.400";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.server.net4j;version="4.1.400"
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 0b38c4471c..facc99bf1f 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
@@ -126,19 +126,44 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
commitContext.preWrite();
long lastUpdateTime = in.readLong();
- boolean autoReleaseLocksEnabled = in.readBoolean();
int commitNumber = in.readInt();
String commitComment = in.readString();
- InternalCDOPackageUnit[] newPackageUnits = new InternalCDOPackageUnit[in.readInt()];
CDOLockState[] locksOnNewObjects = new CDOLockState[in.readInt()];
+ CDOID[] idsToUnlock = new CDOID[in.readInt()];
+ InternalCDOPackageUnit[] newPackageUnits = new InternalCDOPackageUnit[in.readInt()];
InternalCDORevision[] newObjects = new InternalCDORevision[in.readInt()];
InternalCDORevisionDelta[] dirtyObjectDeltas = new InternalCDORevisionDelta[in.readInt()];
CDOID[] detachedObjects = new CDOID[in.readInt()];
- monitor.begin(newPackageUnits.length + newObjects.length + dirtyObjectDeltas.length + detachedObjects.length);
+ monitor.begin(locksOnNewObjects.length + idsToUnlock.length + newPackageUnits.length + newObjects.length
+ + dirtyObjectDeltas.length + detachedObjects.length);
try
{
+ // Locks on new objects
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Reading {0} locks on new objects", locksOnNewObjects.length); //$NON-NLS-1$
+ }
+
+ for (int i = 0; i < locksOnNewObjects.length; i++)
+ {
+ locksOnNewObjects[i] = in.readCDOLockState();
+ monitor.worked();
+ }
+
+ // Unlocks on changed objects
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Reading {0} IDs to unlock", idsToUnlock.length); //$NON-NLS-1$
+ }
+
+ for (int i = 0; i < idsToUnlock.length; i++)
+ {
+ idsToUnlock[i] = in.readCDOID();
+ monitor.worked();
+ }
+
// New package units
if (TRACER.isEnabled())
{
@@ -161,18 +186,6 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
EMFUtil.safeResolveAll(resourceSet);
}
- // Locks on new objects
- if (TRACER.isEnabled())
- {
- TRACER.format("Reading {0} locks on new objects", locksOnNewObjects.length); //$NON-NLS-1$
- }
-
- for (int i = 0; i < locksOnNewObjects.length; i++)
- {
- locksOnNewObjects[i] = in.readCDOLockState();
- monitor.worked();
- }
-
// New objects
if (TRACER.isEnabled())
{
@@ -274,7 +287,6 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
commitContext.setCommitNumber(commitNumber);
commitContext.setLastUpdateTime(lastUpdateTime);
- commitContext.setAutoReleaseLocksEnabled(autoReleaseLocksEnabled);
commitContext.setClearResourcePathCache(clearResourcePathCache);
commitContext.setUsingEcore(usingEcore);
commitContext.setUsingEtypes(usingEtypes);
@@ -287,6 +299,8 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
commitContext.setDetachedObjectVersions(detachedObjectVersions);
commitContext.setCommitComment(commitComment);
commitContext.setLobs(getIndicationStream());
+ commitContext.setLocksOnNewObjects(locksOnNewObjects);
+ commitContext.setIDsToUnlock(idsToUnlock);
}
finally
{

Back to the top