Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-07-30 09:16:35 -0400
committerEike Stepper2016-07-30 09:16:35 -0400
commit915fe3f55eb53acb190536a314e885d2a05d9720 (patch)
treed7a684ded717d97b89da72d50760a75cbcdd6c6f /plugins
parent6dc966a83269a207a5538850648ea23697c682bc (diff)
downloadcdo-915fe3f55eb53acb190536a314e885d2a05d9720.tar.gz
cdo-915fe3f55eb53acb190536a314e885d2a05d9720.tar.xz
cdo-915fe3f55eb53acb190536a314e885d2a05d9720.zip
Revert "[$387563] $Generalize the "lock of new objects on commit" feature to the "lock/unlock objects on commit" "
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF68
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/lock/InternalCDOLockState.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitTransactionRequest.java59
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateRawCommitContext.java11
-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
-rw-r--r--plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF22
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingCommitContext.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java194
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java34
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF26
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingNotificationsTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_355045_Test.java205
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_387563_Test.java181
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_387563b_Test.java114
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_466951_Test.java137
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF36
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/plugin.xml1
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AutoReleaseLockExemptionAction.java91
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java119
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties1
-rw-r--r--plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF52
-rw-r--r--plugins/org.eclipse.emf.cdo/plugin.xml6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOCommitContext.java29
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java111
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/ObjectProperties.java23
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java257
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOUndoDetectorImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java26
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java137
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java23
-rw-r--r--plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF62
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java14
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWOLockManager.java171
-rw-r--r--plugins/org.eclipse.net4j/META-INF/MANIFEST.MF32
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalCounter.java42
48 files changed, 684 insertions, 1780 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
index 05e58aba70..f9852b96bc 100644
--- a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.common
-Bundle-Version: 4.6.0.qualifier
+Bundle-Version: 4.5.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -14,21 +14,21 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";visibili
org.eclipse.emf.ecore.change;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.common;version="4.6.0",
- org.eclipse.emf.cdo.common.admin;version="4.6.0",
- org.eclipse.emf.cdo.common.branch;version="4.6.0",
- org.eclipse.emf.cdo.common.commit;version="4.6.0",
- org.eclipse.emf.cdo.common.commit.handler;version="4.6.0",
- org.eclipse.emf.cdo.common.id;version="4.6.0",
- org.eclipse.emf.cdo.common.lob;version="4.6.0",
- org.eclipse.emf.cdo.common.lock;version="4.6.0",
- org.eclipse.emf.cdo.common.model;version="4.6.0",
- org.eclipse.emf.cdo.common.protocol;version="4.6.0",
- org.eclipse.emf.cdo.common.revision;version="4.6.0",
- org.eclipse.emf.cdo.common.revision.delta;version="4.6.0",
- org.eclipse.emf.cdo.common.security;version="4.6.0",
- org.eclipse.emf.cdo.common.util;version="4.6.0",
- org.eclipse.emf.cdo.internal.common;version="4.6.0";
+Export-Package: org.eclipse.emf.cdo.common;version="4.5.0",
+ org.eclipse.emf.cdo.common.admin;version="4.5.0",
+ org.eclipse.emf.cdo.common.branch;version="4.5.0",
+ org.eclipse.emf.cdo.common.commit;version="4.5.0",
+ org.eclipse.emf.cdo.common.commit.handler;version="4.5.0",
+ org.eclipse.emf.cdo.common.id;version="4.5.0",
+ org.eclipse.emf.cdo.common.lob;version="4.5.0",
+ org.eclipse.emf.cdo.common.lock;version="4.5.0",
+ org.eclipse.emf.cdo.common.model;version="4.5.0",
+ org.eclipse.emf.cdo.common.protocol;version="4.5.0",
+ org.eclipse.emf.cdo.common.revision;version="4.5.0",
+ org.eclipse.emf.cdo.common.revision.delta;version="4.5.0",
+ org.eclipse.emf.cdo.common.security;version="4.5.0",
+ org.eclipse.emf.cdo.common.util;version="4.5.0",
+ org.eclipse.emf.cdo.internal.common;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -38,11 +38,11 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.6.0",
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.server.hibernate",
- org.eclipse.emf.cdo.internal.common.branch;version="4.6.0";
+ org.eclipse.emf.cdo.internal.common.branch;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.server.hibernate",
- org.eclipse.emf.cdo.internal.common.bundle;version="4.6.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.commit;version="4.6.0";
+ org.eclipse.emf.cdo.internal.common.bundle;version="4.5.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.commit;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -51,7 +51,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.6.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.id;version="4.6.0";
+ org.eclipse.emf.cdo.internal.common.id;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -62,9 +62,9 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.6.0",
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.admin,
org.eclipse.emf.cdo.server.admin",
- org.eclipse.emf.cdo.internal.common.lock;version="4.6.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.messages;version="4.6.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.model;version="4.6.0";
+ org.eclipse.emf.cdo.internal.common.lock;version="4.5.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.messages;version="4.5.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.model;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -73,7 +73,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.6.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.revision;version="4.6.0";
+ org.eclipse.emf.cdo.internal.common.revision;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -82,7 +82,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.6.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.revision.delta;version="4.6.0";
+ org.eclipse.emf.cdo.internal.common.revision.delta;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -91,12 +91,12 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.6.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.spi.common;version="4.6.0",
- org.eclipse.emf.cdo.spi.common.admin;version="4.6.0",
- org.eclipse.emf.cdo.spi.common.branch;version="4.6.0",
- org.eclipse.emf.cdo.spi.common.commit;version="4.6.0",
- org.eclipse.emf.cdo.spi.common.id;version="4.6.0",
- org.eclipse.emf.cdo.spi.common.lock;version="4.6.0",
- org.eclipse.emf.cdo.spi.common.model;version="4.6.0",
- org.eclipse.emf.cdo.spi.common.protocol;version="4.6.0",
- org.eclipse.emf.cdo.spi.common.revision;version="4.6.0"
+ org.eclipse.emf.cdo.spi.common;version="4.5.0",
+ org.eclipse.emf.cdo.spi.common.admin;version="4.5.0",
+ org.eclipse.emf.cdo.spi.common.branch;version="4.5.0",
+ org.eclipse.emf.cdo.spi.common.commit;version="4.5.0",
+ org.eclipse.emf.cdo.spi.common.id;version="4.5.0",
+ org.eclipse.emf.cdo.spi.common.lock;version="4.5.0",
+ org.eclipse.emf.cdo.spi.common.model;version="4.5.0",
+ org.eclipse.emf.cdo.spi.common.protocol;version="4.5.0",
+ org.eclipse.emf.cdo.spi.common.revision;version="4.5.0"
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/lock/InternalCDOLockState.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/lock/InternalCDOLockState.java
index cb0dac0f83..4d5b8bddc2 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/lock/InternalCDOLockState.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/lock/InternalCDOLockState.java
@@ -10,10 +10,8 @@
*/
package org.eclipse.emf.cdo.spi.common.lock;
-import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockOwner;
import org.eclipse.emf.cdo.common.lock.CDOLockState;
-import org.eclipse.emf.cdo.internal.common.lock.CDOLockStateImpl;
/**
* If the meaning of this type isn't clear, there really should be more of a description here...
@@ -25,11 +23,6 @@ import org.eclipse.emf.cdo.internal.common.lock.CDOLockStateImpl;
*/
public interface InternalCDOLockState extends CDOLockState
{
- /**
- * @since 4.6
- */
- public static final CDOLockState UNLOCKED = new CDOLockStateImpl(CDOID.NULL);
-
public void addReadLockOwner(CDOLockOwner lockOwner);
public boolean removeReadLockOwner(CDOLockOwner lockOwner);
diff --git a/plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF
index 6d13a12a79..32eca96ebf 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.net4j/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.net4j; singleton:=true
-Bundle-Version: 4.1.500.qualifier
+Bundle-Version: 4.1.400.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -10,17 +10,17 @@ Bundle-Activator: org.eclipse.emf.cdo.internal.net4j.bundle.OM$Activator
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.emf.cdo;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.internal.net4j;version="4.1.500";
+Export-Package: org.eclipse.emf.cdo.internal.net4j;version="4.1.400";
x-friends:="org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.defs,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.examples",
- org.eclipse.emf.cdo.internal.net4j.bundle;version="4.1.500";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.net4j.messages;version="4.1.500";x-internal:=true,
- org.eclipse.emf.cdo.internal.net4j.protocol;version="4.1.500";
+ org.eclipse.emf.cdo.internal.net4j.bundle;version="4.1.400";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.internal.net4j.messages;version="4.1.400";x-internal:=true,
+ org.eclipse.emf.cdo.internal.net4j.protocol;version="4.1.400";
x-friends:="org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.defs,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.examples",
- org.eclipse.emf.cdo.net4j;version="4.1.500"
+ org.eclipse.emf.cdo.net4j;version="4.1.400"
Bundle-ActivationPolicy: lazy
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 3f84e0d70f..acf0b462c9 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
@@ -69,24 +69,26 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com
private static long sleepMillisForTesting = 0L;
- private final int commitNumber;
+ private CDOIDProvider idProvider; // CDOTransaction
- private final String commitComment;
+ private int commitNumber;
- private final CDOCommitData commitData;
+ private String commitComment;
- private final Collection<CDOLob<?>> lobs;
+ private boolean releaseLocks;
- private final Collection<CDOLockState> locksOnNewObjects;
+ private CDOCommitData commitData;
- private final Collection<CDOID> idsToUnlock;
+ private Collection<CDOLob<?>> lobs;
- private final int viewID;
+ private Collection<CDOLockState> locksOnNewObjects;
+
+ private int viewID;
/**
* Is <code>null</code> in {@link CommitDelegationRequest}.
*/
- private final InternalCDOTransaction transaction;
+ private InternalCDOTransaction transaction;
private boolean clearResourcePathCache;
@@ -98,23 +100,20 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com
public CommitTransactionRequest(CDOClientProtocol protocol, short signalID, InternalCDOCommitContext context)
{
super(protocol, signalID);
- transaction = context.getTransaction();
+ transaction = context.getTransaction();
CommitToken commitToken = transaction.getCommitToken();
if (commitToken != null)
{
commitNumber = commitToken.getCommitNumber();
}
- else
- {
- commitNumber = 0;
- }
commitComment = context.getCommitComment();
+ releaseLocks = context.isAutoReleaseLocks();
+ idProvider = context.getTransaction();
commitData = context.getCommitData();
lobs = context.getLobs();
locksOnNewObjects = context.getLocksOnNewObjects();
- idsToUnlock = context.getIDsToUnlock();
viewID = context.getViewID();
}
@@ -128,7 +127,7 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com
@Override
protected CDOIDProvider getIDProvider()
{
- return transaction;
+ return idProvider;
}
@Override
@@ -151,43 +150,33 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com
List<CDOIDAndVersion> detachedObjects = commitData.getDetachedObjects();
out.writeLong(getLastUpdateTime());
+ out.writeBoolean(releaseLocks);
out.writeInt(commitNumber);
out.writeString(commitComment);
- out.writeInt(locksOnNewObjects.size());
- out.writeInt(idsToUnlock.size());
out.writeInt(newPackageUnits.size());
+ out.writeInt(locksOnNewObjects.size());
out.writeInt(newObjects.size());
out.writeInt(changedObjects.size());
out.writeInt(detachedObjects.size());
if (TRACER.isEnabled())
{
- TRACER.format("Writing {0} locks on new objects", locksOnNewObjects.size()); //$NON-NLS-1$
- }
-
- for (CDOLockState lockState : locksOnNewObjects)
- {
- out.writeCDOLockState(lockState);
- }
-
- if (TRACER.isEnabled())
- {
- TRACER.format("Writing {0} unlocks on changed objects", idsToUnlock.size()); //$NON-NLS-1$
+ TRACER.format("Writing {0} new package units", newPackageUnits.size()); //$NON-NLS-1$
}
- for (CDOID id : idsToUnlock)
+ for (CDOPackageUnit newPackageUnit : newPackageUnits)
{
- out.writeCDOID(id);
+ out.writeCDOPackageUnit(newPackageUnit, true);
}
if (TRACER.isEnabled())
{
- TRACER.format("Writing {0} new package units", newPackageUnits.size()); //$NON-NLS-1$
+ TRACER.format("Writing {0} locks on new objects", locksOnNewObjects.size()); //$NON-NLS-1$
}
- for (CDOPackageUnit newPackageUnit : newPackageUnits)
+ for (CDOLockState lockState : locksOnNewObjects)
{
- out.writeCDOPackageUnit(newPackageUnit, true);
+ out.writeCDOLockState(lockState);
}
if (TRACER.isEnabled())
@@ -330,7 +319,7 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com
}
CommitTransactionResult result = new CommitTransactionResult();
- result.setIDProvider(transaction);
+ result.setIDProvider(idProvider);
result.setClearResourcePathCache(clearResourcePathCache);
result.setRollbackReason(in.readByte());
result.setRollbackMessage(in.readString());
@@ -356,7 +345,7 @@ public class CommitTransactionRequest extends CDOClientRequestWithMonitoring<Com
protected CommitTransactionResult confirmingResult(CDODataInput in) throws IOException
{
CommitTransactionResult result = new CommitTransactionResult();
- result.setIDProvider(transaction);
+ result.setIDProvider(idProvider);
result.setClearResourcePathCache(clearResourcePathCache);
result.setBranchPoint(in.readCDOBranchPoint());
result.setPreviousTimeStamp(in.readLong());
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF
index be3924ee4b..bdab554bc5 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.server.hibernate;singleton:=true
-Bundle-Version: 4.2.400.qualifier
+Bundle-Version: 4.2.300.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -14,11 +14,11 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.emf.cdo.common;bundle-version="[4.0.0,5.0.0)",
org.eclipse.emf.cdo.server;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j.db;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.server.hibernate;version="4.2.400",
- org.eclipse.emf.cdo.server.internal.hibernate;version="4.2.400";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate",
- org.eclipse.emf.cdo.server.internal.hibernate.bundle;version="4.2.400";x-internal:=true,
- org.eclipse.emf.cdo.server.internal.hibernate.info;version="4.2.400";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate",
- org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;version="4.2.400";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate"
+Export-Package: org.eclipse.emf.cdo.server.hibernate;version="4.2.300",
+ org.eclipse.emf.cdo.server.internal.hibernate;version="4.2.300";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate",
+ org.eclipse.emf.cdo.server.internal.hibernate.bundle;version="4.2.300";x-internal:=true,
+ org.eclipse.emf.cdo.server.internal.hibernate.info;version="4.2.300";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate",
+ org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;version="4.2.300";x-friends:="org.eclipse.emf.cdo.server.hibernate.teneo,org.eclipse.emf.cdo.tests.hibernate"
Import-Package: org.apache.log4j;version="[1.2.0,2.0.0)",
org.eclipse.emf.teneo;version="[2.0.1,3.0.0)",
org.eclipse.emf.teneo.annotations.mapper;version="[2.0.1,3.0.0)",
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateRawCommitContext.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateRawCommitContext.java
index 6692fb2f87..ee8b86b579 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateRawCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateRawCommitContext.java
@@ -125,7 +125,6 @@ public class HibernateRawCommitContext implements InternalCommitContext
{
}
- @Deprecated
public boolean isAutoReleaseLocksEnabled()
{
return false;
@@ -161,11 +160,6 @@ public class HibernateRawCommitContext implements InternalCommitContext
return null;
}
- public CDOID[] getIDsToUnlock()
- {
- return null;
- }
-
public InternalCDORevision[] getNewObjects()
{
return newObjects.toArray(new InternalCDORevision[0]);
@@ -309,10 +303,6 @@ public class HibernateRawCommitContext implements InternalCommitContext
{
}
- public void setIDsToUnlock(CDOID[] idsToUnlock)
- {
- }
-
public void setNewObjects(InternalCDORevision[] newObjects)
{
}
@@ -337,7 +327,6 @@ public class HibernateRawCommitContext implements InternalCommitContext
{
}
- @Deprecated
public void setAutoReleaseLocksEnabled(boolean on)
{
}
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 9254099351..048d55afcd 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.400.qualifier
+Bundle-Version: 4.1.300.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.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"
+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"
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 facc99bf1f..0b38c4471c 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,44 +126,19 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
commitContext.preWrite();
long lastUpdateTime = in.readLong();
+ boolean autoReleaseLocksEnabled = in.readBoolean();
int commitNumber = in.readInt();
String commitComment = in.readString();
- CDOLockState[] locksOnNewObjects = new CDOLockState[in.readInt()];
- CDOID[] idsToUnlock = new CDOID[in.readInt()];
InternalCDOPackageUnit[] newPackageUnits = new InternalCDOPackageUnit[in.readInt()];
+ CDOLockState[] locksOnNewObjects = new CDOLockState[in.readInt()];
InternalCDORevision[] newObjects = new InternalCDORevision[in.readInt()];
InternalCDORevisionDelta[] dirtyObjectDeltas = new InternalCDORevisionDelta[in.readInt()];
CDOID[] detachedObjects = new CDOID[in.readInt()];
- monitor.begin(locksOnNewObjects.length + idsToUnlock.length + newPackageUnits.length + newObjects.length
- + dirtyObjectDeltas.length + detachedObjects.length);
+ monitor.begin(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())
{
@@ -186,6 +161,18 @@ 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())
{
@@ -287,6 +274,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
commitContext.setCommitNumber(commitNumber);
commitContext.setLastUpdateTime(lastUpdateTime);
+ commitContext.setAutoReleaseLocksEnabled(autoReleaseLocksEnabled);
commitContext.setClearResourcePathCache(clearResourcePathCache);
commitContext.setUsingEcore(usingEcore);
commitContext.setUsingEtypes(usingEtypes);
@@ -299,8 +287,6 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
commitContext.setDetachedObjectVersions(detachedObjectVersions);
commitContext.setCommitComment(commitComment);
commitContext.setLobs(getIndicationStream());
- commitContext.setLocksOnNewObjects(locksOnNewObjects);
- commitContext.setIDsToUnlock(idsToUnlock);
}
finally
{
diff --git a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
index 3e0cb2e804..8a287f1d7e 100644
--- a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.server;singleton:=true
-Bundle-Version: 4.6.0.qualifier
+Bundle-Version: 4.5.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -10,18 +10,18 @@ Bundle-Activator: org.eclipse.emf.cdo.internal.server.bundle.OM$Activator
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.internal.server;version="4.6.0";
+Export-Package: org.eclipse.emf.cdo.internal.server;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.server.db,
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.workspace,
org.eclipse.emf.cdo.server.hibernate",
- org.eclipse.emf.cdo.internal.server.bundle;version="4.6.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.server.embedded;version="4.6.0";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.server.mem;version="4.6.0";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.server.messages;version="4.6.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.server.syncing;version="4.6.0";x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.server;version="4.6.0",
- org.eclipse.emf.cdo.server.embedded;version="4.6.0",
- org.eclipse.emf.cdo.server.mem;version="4.6.0",
- org.eclipse.emf.cdo.spi.server;version="4.6.0"
+ org.eclipse.emf.cdo.internal.server.bundle;version="4.5.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.server.embedded;version="4.5.0";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.internal.server.mem;version="4.5.0";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.internal.server.messages;version="4.5.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.server.syncing;version="4.5.0";x-friends:="org.eclipse.emf.cdo.tests",
+ org.eclipse.emf.cdo.server;version="4.5.0",
+ org.eclipse.emf.cdo.server.embedded;version="4.5.0",
+ org.eclipse.emf.cdo.server.mem;version="4.5.0",
+ org.eclipse.emf.cdo.spi.server;version="4.5.0"
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 bf696c809f..a6872ffee7 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
@@ -61,6 +61,11 @@ public abstract class DelegatingCommitContext implements IStoreAccessor.CommitCo
return getDelegate().getCommitComment();
}
+ public boolean isAutoReleaseLocksEnabled()
+ {
+ return getDelegate().isAutoReleaseLocksEnabled();
+ }
+
public InternalCDOPackageRegistry getPackageRegistry()
{
return getDelegate().getPackageRegistry();
@@ -131,22 +136,11 @@ public abstract class DelegatingCommitContext implements IStoreAccessor.CommitCo
return getDelegate().isUsingEtypes();
}
- @Deprecated
- public boolean isAutoReleaseLocksEnabled()
- {
- return getDelegate().isAutoReleaseLocksEnabled();
- }
-
public CDOLockState[] getLocksOnNewObjects()
{
return getDelegate().getLocksOnNewObjects();
}
- public CDOID[] getIDsToUnlock()
- {
- return getDelegate().getIDsToUnlock();
- }
-
public CDOBranchVersion[] getDetachedObjectVersions()
{
return getDelegate().getDetachedObjectVersions();
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 b20e5a377b..5163a45593 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
@@ -78,7 +78,6 @@ import org.eclipse.net4j.util.CheckUtil;
import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.collection.IndexedList;
import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
-import org.eclipse.net4j.util.concurrent.RWOLockManager;
import org.eclipse.net4j.util.concurrent.RWOLockManager.LockState;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
@@ -93,6 +92,7 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -147,6 +147,8 @@ public class TransactionCommitContext implements InternalCommitContext
private InternalCDOPackageUnit[] newPackageUnits = new InternalCDOPackageUnit[0];
+ private CDOLockState[] locksOnNewObjects = new CDOLockState[0];
+
private InternalCDORevision[] newObjects = new InternalCDORevision[0];
private InternalCDORevisionDelta[] dirtyObjectDeltas = new InternalCDORevisionDelta[0];
@@ -177,7 +179,7 @@ public class TransactionCommitContext implements InternalCommitContext
private List<CDOIDReference> xRefs;
- private final List<LockState<Object, IView>> postCommitLockStates = new ArrayList<LockState<Object, IView>>();
+ private List<LockState<Object, IView>> postCommitLockStates;
private boolean hasChanges;
@@ -185,11 +187,9 @@ public class TransactionCommitContext implements InternalCommitContext
private boolean ensuringReferentialIntegrity;
- private ExtendedDataInputStream lobs;
-
- private CDOLockState[] locksOnNewObjects = new CDOLockState[0];
+ private boolean autoReleaseLocksEnabled;
- private CDOID[] idsToUnlock = new CDOID[0];
+ private ExtendedDataInputStream lobs;
private Map<Object, Object> data;
@@ -238,6 +238,11 @@ public class TransactionCommitContext implements InternalCommitContext
return lastUpdateTime;
}
+ public boolean isAutoReleaseLocksEnabled()
+ {
+ return autoReleaseLocksEnabled;
+ }
+
public byte getRollbackReason()
{
return rollbackReason;
@@ -289,6 +294,11 @@ public class TransactionCommitContext implements InternalCommitContext
return newPackageUnits;
}
+ public CDOLockState[] getLocksOnNewObjects()
+ {
+ return locksOnNewObjects;
+ }
+
public InternalCDORevision[] getNewObjects()
{
return newObjects;
@@ -516,6 +526,11 @@ public class TransactionCommitContext implements InternalCommitContext
this.newPackageUnits = newPackageUnits;
}
+ public void setLocksOnNewObjects(CDOLockState[] locksOnNewObjects)
+ {
+ this.locksOnNewObjects = locksOnNewObjects;
+ }
+
public void setNewObjects(InternalCDORevision[] newObjects)
{
this.newObjects = newObjects;
@@ -546,6 +561,11 @@ public class TransactionCommitContext implements InternalCommitContext
this.lastUpdateTime = lastUpdateTime;
}
+ public void setAutoReleaseLocksEnabled(boolean on)
+ {
+ autoReleaseLocksEnabled = on;
+ }
+
public void setCommitNumber(int commitNumber)
{
this.commitNumber = commitNumber;
@@ -566,38 +586,6 @@ public class TransactionCommitContext implements InternalCommitContext
lobs = in;
}
- @Deprecated
- public boolean isAutoReleaseLocksEnabled()
- {
- return false;
- }
-
- @Deprecated
- public void setAutoReleaseLocksEnabled(boolean on)
- {
- // Do nothing.
- }
-
- public CDOLockState[] getLocksOnNewObjects()
- {
- return locksOnNewObjects;
- }
-
- public void setLocksOnNewObjects(CDOLockState[] locksOnNewObjects)
- {
- this.locksOnNewObjects = locksOnNewObjects;
- }
-
- public CDOID[] getIDsToUnlock()
- {
- return idsToUnlock;
- }
-
- public void setIDsToUnlock(CDOID[] idsToUnlock)
- {
- this.idsToUnlock = idsToUnlock;
- }
-
public <T> T getData(Object key)
{
if (data == null)
@@ -1119,6 +1107,50 @@ public class TransactionCommitContext implements InternalCommitContext
}
}
+ protected synchronized void unlockObjects()
+ {
+ // Unlock objects locked during commit
+ if (!lockedObjects.isEmpty())
+ {
+ lockManager.unlock2(LockType.WRITE, transaction, lockedObjects);
+ lockedObjects.clear();
+ }
+
+ // Release durable locks that have been acquired on detached objects
+ if (detachedObjects.length > 0)
+ {
+ boolean branching = repository.isSupportingBranches();
+ Collection<? extends Object> unlockables;
+ if (branching)
+ {
+ List<CDOIDAndBranch> keys = new ArrayList<CDOIDAndBranch>(detachedObjects.length);
+ for (CDOID id : detachedObjects)
+ {
+ CDOIDAndBranch idAndBranch = CDOIDUtil.createIDAndBranch(id, branch);
+ keys.add(idAndBranch);
+ }
+
+ unlockables = keys;
+ }
+ else
+ {
+ unlockables = Arrays.asList(detachedObjects);
+ }
+
+ // We only need to consider detached objects that have been explicitly locked
+ Collection<Object> detachedObjectsToUnlock = new ArrayList<Object>();
+ for (Object unlockable : unlockables)
+ {
+ if (lockManager.hasLock(LockType.WRITE, transaction, unlockable))
+ {
+ detachedObjectsToUnlock.add(unlockable);
+ }
+ }
+
+ lockManager.unlock2(true, LockType.WRITE, transaction, detachedObjectsToUnlock, false);
+ }
+ }
+
protected void computeDirtyObjects(OMMonitor monitor)
{
try
@@ -1323,7 +1355,7 @@ public class TransactionCommitContext implements InternalCommitContext
}
}
- releaseImplicitLocks();
+ unlockObjects();
}
}
@@ -1342,22 +1374,24 @@ public class TransactionCommitContext implements InternalCommitContext
addRevisions(dirtyObjects, monitor.fork());
reviseDetachedObjects(monitor.fork());
- releaseImplicitLocks();
+ unlockObjects();
monitor.worked();
- acquireLocksOnNewObjects();
+ applyLocksOnNewObjects();
monitor.worked();
- autoReleaseExplicitLocks();
- monitor.worked();
-
- if (!postCommitLockStates.isEmpty())
+ if (autoReleaseLocksEnabled)
{
- // TODO (CD) Does doing this here make sense?
- // The commit notifications get sent later, from postCommit.
- sendLockNotifications(postCommitLockStates);
+ postCommitLockStates = lockManager.unlock2(true, transaction);
+ if (!postCommitLockStates.isEmpty())
+ {
+ // TODO (CD) Does doing this here make sense?
+ // The commit notifications get sent later, from postCommit.
+ sendLockNotifications(postCommitLockStates);
+ }
}
+ monitor.worked();
repository.notifyWriteAccessHandlers(transaction, this, false, monitor.fork());
}
catch (Throwable t)
@@ -1370,26 +1404,15 @@ public class TransactionCommitContext implements InternalCommitContext
}
}
- protected synchronized void releaseImplicitLocks()
- {
- // Unlock objects locked during commit
- if (!lockedObjects.isEmpty())
- {
- lockManager.unlock2(LockType.WRITE, transaction, lockedObjects);
- lockedObjects.clear();
- }
- }
-
- protected void acquireLocksOnNewObjects() throws InterruptedException
+ protected void applyLocksOnNewObjects() throws InterruptedException
{
final CDOLockOwner owner = CDOLockUtil.createLockOwner(transaction);
- final boolean mapIDs = transaction.getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE;
for (CDOLockState lockState : locksOnNewObjects)
{
Object target = lockState.getLockedObject();
- if (mapIDs)
+ if (transaction.getRepository().getIDGenerationLocation() == IDGenerationLocation.STORE)
{
CDOIDAndBranch idAndBranch = target instanceof CDOIDAndBranch ? (CDOIDAndBranch)target : null;
CDOID id = idAndBranch != null ? ((CDOIDAndBranch)target).getID() : (CDOID)target;
@@ -1399,60 +1422,13 @@ public class TransactionCommitContext implements InternalCommitContext
target = idAndBranch != null ? CDOIDUtil.createIDAndBranch(newID, idAndBranch.getBranch()) : newID;
}
- LockState<Object, IView> postCommitLockState = null;
for (LockType type : LockType.values())
{
if (lockState.isLocked(type, owner, false))
{
- List<LockState<Object, IView>> lockStates = lockManager.lock2(type, transaction,
- Collections.singleton(target), 0);
- postCommitLockState = lockStates.get(0);
+ lockManager.lock2(type, transaction, Collections.singleton(target), 0);
}
}
-
- if (postCommitLockState != null)
- {
- postCommitLockStates.add(postCommitLockState);
- }
- }
- }
-
- protected void autoReleaseExplicitLocks() throws InterruptedException
- {
- List<Object> targets = new ArrayList<Object>();
-
- // Release locks that have been sent from the client.
- for (CDOID id : idsToUnlock)
- {
- Object target = lockManager.getLockKey(id, branch);
- targets.add(target);
- }
-
- // Release durable locks that have been acquired on detached objects.
- for (CDOID id : detachedObjects)
- {
- Object target = lockManager.getLockKey(id, branch);
- if (lockManager.hasLock(LockType.WRITE, transaction, target))
- {
- // We only need to consider detached objects that have been explicitly locked
- targets.add(target);
- }
- }
-
- try
- {
- RWOLockManager.setUnlockAll(true);
-
- List<LockState<Object, IView>> lockStates = lockManager.unlock2(true, LockType.WRITE, transaction, targets,
- false);
- if (lockStates != null)
- {
- postCommitLockStates.addAll(lockStates);
- }
- }
- finally
- {
- RWOLockManager.setUnlockAll(false);
}
}
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 2ddb48c2e3..0151075080 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
@@ -1022,6 +1022,13 @@ public abstract class SynchronizableRepository extends Repository.Default implem
throw new UnsupportedOperationException();
}
+ public Collection<CDOLockState> getLocksOnNewObjects()
+ {
+ CDOLockState[] locksOnNewObjectsArr = WriteThroughCommitContext.this.getLocksOnNewObjects();
+ Collection<CDOLockState> locksOnNewObjects = Arrays.asList(locksOnNewObjectsArr);
+ return locksOnNewObjects;
+ }
+
public Collection<CDOLob<?>> getLobs()
{
return Collections.emptySet(); // TODO (CD) Did we forget to support this earlier?
@@ -1067,24 +1074,11 @@ public abstract class SynchronizableRepository extends Repository.Default implem
return WriteThroughCommitContext.this.getUserID();
}
- @Deprecated
public boolean isAutoReleaseLocks()
{
return WriteThroughCommitContext.this.isAutoReleaseLocksEnabled();
}
- public Collection<CDOLockState> getLocksOnNewObjects()
- {
- CDOLockState[] locksOnNewObjectsArray = WriteThroughCommitContext.this.getLocksOnNewObjects();
- return Arrays.asList(locksOnNewObjectsArray);
- }
-
- public Collection<CDOID> getIDsToUnlock()
- {
- CDOID[] idsToUnlockArray = WriteThroughCommitContext.this.getIDsToUnlock();
- return Arrays.asList(idsToUnlockArray);
- }
-
public String getCommitComment()
{
return WriteThroughCommitContext.this.getCommitComment();
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 1d4f132e69..332a01f1da 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
@@ -312,6 +312,11 @@ public interface IStoreAccessor extends IQueryHandlerProvider, BranchLoader, Com
public long getLastUpdateTime();
/**
+ * @since 3.0
+ */
+ public boolean isAutoReleaseLocksEnabled();
+
+ /**
* Returns the temporary, transactional package manager associated with the commit operation represented by this
* <code>CommitContext</code>. In addition to the packages registered with the session this package manager also
* contains the new packages that are part of this commit operation.
@@ -345,6 +350,14 @@ public interface IStoreAccessor extends IQueryHandlerProvider, BranchLoader, Com
public InternalCDOPackageUnit[] getNewPackageUnits();
/**
+ * Returns an array of the locks on the new objects that are part of the commit operation represented by this
+ * <code>CommitContext</code>.
+ *
+ * @since 4.1
+ */
+ public CDOLockState[] getLocksOnNewObjects();
+
+ /**
* Returns an array of the new objects that are part of the commit operation represented by this
* <code>CommitContext</code>.
*/
@@ -407,27 +420,6 @@ public interface IStoreAccessor extends IQueryHandlerProvider, BranchLoader, Com
public ExtendedDataInputStream getLobs();
/**
- *
- * @since 3.0
- * @deprecated As of 4.5 no longer supported. See {@link #getIDsToUnlock()}.
- */
- @Deprecated
- public boolean isAutoReleaseLocksEnabled();
-
- /**
- * Returns an array of the locks on the new objects that are part of the commit operation represented by this
- * <code>CommitContext</code>.
- *
- * @since 4.1
- */
- public CDOLockState[] getLocksOnNewObjects();
-
- /**
- * @since 4.6
- */
- public CDOID[] getIDsToUnlock();
-
- /**
* Returns an unmodifiable map from all temporary IDs to their persistent counter parts.
*/
public Map<CDOID, CDOID> getIDMappings();
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 fd885b81a5..786f3af1e3 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
@@ -118,6 +118,11 @@ public interface InternalCommitContext extends IStoreAccessor.CommitContext, CDO
public void setNewPackageUnits(InternalCDOPackageUnit[] newPackageUnits);
+ /**
+ * @since 4.1
+ */
+ public void setLocksOnNewObjects(CDOLockState[] locksOnNewObjects);
+
public void setNewObjects(InternalCDORevision[] newObjects);
public void setDirtyObjectDeltas(InternalCDORevisionDelta[] dirtyObjectDeltas);
@@ -139,23 +144,9 @@ public interface InternalCommitContext extends IStoreAccessor.CommitContext, CDO
*/
public void setLastUpdateTime(long lastUpdateTime);
- /**
- * @deprecated As of 4.5 no longer supported. See {@link #setIDsToUnlock(CDOID[])}.
- */
- @Deprecated
public void setAutoReleaseLocksEnabled(boolean on);
/**
- * @since 4.1
- */
- public void setLocksOnNewObjects(CDOLockState[] locksOnNewObjects);
-
- /**
- * @since 4.6
- */
- public void setIDsToUnlock(CDOID[] idsToUnlock);
-
- /**
* @since 4.5
*/
public void setCommitNumber(int commitNumber);
diff --git a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
index 79959cf1d4..51fdfbfdf2 100644
--- a/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.tests/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.tests;singleton:=true
-Bundle-Version: 4.0.600.qualifier
+Bundle-Version: 4.0.500.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -47,18 +47,18 @@ Export-Package: base;version="4.0.200",
interface_;version="4.0.200",
interface_.impl;version="4.0.200",
interface_.util;version="4.0.200",
- org.eclipse.emf.cdo.tests;version="4.0.600",
- org.eclipse.emf.cdo.tests.bugzilla;version="4.0.600",
- org.eclipse.emf.cdo.tests.bundle;version="4.0.600";x-internal:=true,
- org.eclipse.emf.cdo.tests.config;version="4.0.600",
- org.eclipse.emf.cdo.tests.config.impl;version="4.0.600",
- org.eclipse.emf.cdo.tests.defs;version="4.0.600",
- org.eclipse.emf.cdo.tests.extra;version="4.0.600",
- org.eclipse.emf.cdo.tests.offline;version="4.0.600",
- org.eclipse.emf.cdo.tests.performance;version="4.0.600",
- org.eclipse.emf.cdo.tests.performance.framework;version="4.0.600",
- org.eclipse.emf.cdo.tests.revisioncache;version="4.0.600",
- org.eclipse.emf.cdo.tests.util;version="4.0.600",
+ org.eclipse.emf.cdo.tests;version="4.0.500",
+ org.eclipse.emf.cdo.tests.bugzilla;version="4.0.500",
+ org.eclipse.emf.cdo.tests.bundle;version="4.0.500";x-internal:=true,
+ org.eclipse.emf.cdo.tests.config;version="4.0.500",
+ org.eclipse.emf.cdo.tests.config.impl;version="4.0.500",
+ org.eclipse.emf.cdo.tests.defs;version="4.0.500",
+ org.eclipse.emf.cdo.tests.extra;version="4.0.500",
+ org.eclipse.emf.cdo.tests.offline;version="4.0.500",
+ org.eclipse.emf.cdo.tests.performance;version="4.0.500",
+ org.eclipse.emf.cdo.tests.performance.framework;version="4.0.500",
+ org.eclipse.emf.cdo.tests.revisioncache;version="4.0.500",
+ org.eclipse.emf.cdo.tests.util;version="4.0.500",
reference;version="4.0.200",
reference.impl;version="4.0.200";
x-friends:="org.eclipse.emf.cdo.dawn.tests,
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
index 775239a919..0746b51808 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
@@ -1255,7 +1255,7 @@ public class LockingManagerTest extends AbstractLockingTest
assertEquals(false, CDOUtil.getCDOObject(category2).cdoWriteLock().isLocked()); // Implicit locks always released
}
- public void testAutoReleaseExplicitLocks() throws Exception
+ public void testAutoReleaseLocksOnChangedObject() throws Exception
{
Company company = getModel1Factory().createCompany();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingNotificationsTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingNotificationsTest.java
index c484fbc925..d5a46ec911 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingNotificationsTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingNotificationsTest.java
@@ -309,10 +309,8 @@ public class LockingNotificationsTest extends AbstractLockingTest
CDOTransaction tx1 = session1.openTransaction();
tx1.options().setAutoReleaseLocksEnabled(true);
-
CDOResource res1 = tx1.getOrCreateResource(getResourcePath("r1"));
res1.getContents().clear();
-
Company company = getModel1Factory().createCompany();
res1.getContents().add(company);
tx1.commit();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java
index 6721079c85..bdebdba5b6 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/SessionTest.java
@@ -63,14 +63,6 @@ public class SessionTest extends AbstractCDOTest
private static final char[] PASSWORD2 = "invalid".toCharArray(); //$NON-NLS-1$
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
- enableConsole();
-
- }
-
public void testIsSupportingAudits() throws Exception
{
CDOSession session = openSession();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_355045_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_355045_Test.java
deleted file mode 100644
index fad9c66cd3..0000000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_355045_Test.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Esteban Dugueperoux - initial API and implementation
- */
-package org.eclipse.emf.cdo.tests.bugzilla;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.CDOState;
-import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
-import org.eclipse.emf.cdo.common.lock.CDOLockState;
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.tests.AbstractCDOTest;
-import org.eclipse.emf.cdo.tests.model1.Category;
-import org.eclipse.emf.cdo.tests.model1.Company;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CDOUtil;
-
-import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
-
-import org.junit.Assert;
-
-import java.util.Collections;
-
-/**
- * @author Esteban Dugueperoux
- */
-public class Bugzilla_355045_Test extends AbstractCDOTest
-{
- private static final String RESOURCE_PATH = "/test1";
-
- private CDOTransaction transaction;
-
- private Company company;
-
- private Category category1;
-
- @Override
- public void setUp() throws Exception
- {
- super.setUp();
- CDOSession cdoSession = openSession();
- cdoSession.options().setLockNotificationMode(LockNotificationMode.ALWAYS);
- transaction = cdoSession.openTransaction();
- // cdoTransaction.options().setAutoReleaseLocksEnabled(false);
- CDOResource cdoResource = transaction.createResource(getResourcePath(RESOURCE_PATH));
-
- company = getModel1Factory().createCompany();
- category1 = getModel1Factory().createCategory();
- company.getCategories().add(category1);
-
- cdoResource.getContents().add(company);
- cdoResource.save(Collections.emptyMap());
- }
-
- public void testLockOnCommitOfSingleNewObject() throws Exception
- {
- Category category2 = getModel1Factory().createCategory();
- category2.setName("category2");
- category1.getCategories().add(category2);
-
- transaction.lockObjects(CDOUtil.getCDOObjects(category2), LockType.WRITE, DEFAULT_TIMEOUT);
- transaction.options().addAutoReleaseLocksExemptions(true, category2);
- assertLockStatus(category2, true, false);
-
- transaction.commit();
- assertEquals(CDOState.CLEAN, CDOUtil.getCDOObject(category2).cdoState());
- assertLockStatus(category2, true, false);
- }
-
- public void testRecursiveLockOnCommitOfNewObjectsTree() throws Exception
- {
- Category category2 = getModel1Factory().createCategory();
- category2.setName("category2");
- Category category4 = getModel1Factory().createCategory();
- category4.setName("category4");
- Category category5 = getModel1Factory().createCategory();
- category5.setName("category5");
- Category category6 = getModel1Factory().createCategory();
- category6.setName("category6");
- Category category7 = getModel1Factory().createCategory();
- category7.setName("category7");
-
- category2.getCategories().add(category4);
- category2.getCategories().add(category5);
- category4.getCategories().add(category6);
- category5.getCategories().add(category7);
- category1.getCategories().add(category2);
-
- Category category3 = getModel1Factory().createCategory();
- category3.setName("category3");
- Category category8 = getModel1Factory().createCategory();
- category8.setName("category8");
- Category category9 = getModel1Factory().createCategory();
- category9.setName("category9");
- Category category10 = getModel1Factory().createCategory();
- category10.setName("category10");
- Category category11 = getModel1Factory().createCategory();
- category11.setName("category11");
-
- category3.getCategories().add(category8);
- category3.getCategories().add(category9);
- category8.getCategories().add(category10);
- category9.getCategories().add(category11);
- category1.getCategories().add(category3);
-
- transaction.lockObjects(CDOUtil.getCDOObjects(category2), LockType.WRITE, DEFAULT_TIMEOUT, true);
- transaction.options().addAutoReleaseLocksExemptions(true, category2);
-
- assertLockStatus(category1, false, false);
- assertLockStatus(category2, true, true);
- assertLockStatus(category3, false, true);
-
- transaction.lockObjects(CDOUtil.getCDOObjects(category3), LockType.WRITE, DEFAULT_TIMEOUT, true);
- transaction.options().addAutoReleaseLocksExemptions(true, category3);
-
- assertLockStatus(category1, false, false);
- assertLockStatus(category2, true, true);
- assertLockStatus(category3, true, true);
-
- transaction.unlockObjects(CDOUtil.getCDOObjects(category3), LockType.WRITE);
-
- assertLockStatus(category1, false, false);
- assertLockStatus(category2, true, true);
- assertLockStatus(category3, false, false);
- assertLockStatus(category8, true, true);
- assertLockStatus(category9, true, true);
-
- transaction.commit();
-
- assertLockStatus(category1, false, false);
- assertLockStatus(category2, true, true);
- assertLockStatus(category3, false, false);
- assertLockStatus(category8, true, true);
- assertLockStatus(category9, true, true);
- }
-
- public void testRecursiveLockOfObjectsTreeContainingASubTreeOfNewObjects() throws Exception
- {
- Category category2 = getModel1Factory().createCategory();
- category2.setName("category2");
- Category category4 = getModel1Factory().createCategory();
- category4.setName("category4");
- Category category5 = getModel1Factory().createCategory();
- category5.setName("category5");
- Category category6 = getModel1Factory().createCategory();
- category6.setName("category6");
- Category category7 = getModel1Factory().createCategory();
- category7.setName("category7");
-
- category2.getCategories().add(category4);
- category2.getCategories().add(category5);
- category4.getCategories().add(category6);
- category5.getCategories().add(category7);
- category1.getCategories().add(category2);
-
- Category category3 = getModel1Factory().createCategory();
- category3.setName("category3");
- Category category8 = getModel1Factory().createCategory();
- category8.setName("category8");
- Category category9 = getModel1Factory().createCategory();
- category9.setName("category9");
- Category category10 = getModel1Factory().createCategory();
- category10.setName("category10");
- Category category11 = getModel1Factory().createCategory();
- category11.setName("category11");
-
- category3.getCategories().add(category8);
- category3.getCategories().add(category9);
- category8.getCategories().add(category10);
- category9.getCategories().add(category11);
- category1.getCategories().add(category3);
-
- transaction.lockObjects(CDOUtil.getCDOObjects(category1), LockType.WRITE, DEFAULT_TIMEOUT, true);
- transaction.options().addAutoReleaseLocksExemptions(false, category1);
- assertLockStatus(category1, true, false);
-
- transaction.commit();
- assertLockStatus(category1, true, false);
- }
-
- private void assertLockStatus(Category category, boolean lockedByMe, boolean recursive)
- {
- CDOObject categoryCDOObject = CDOUtil.getCDOObject(category);
- CDOLockState cdoLockState = categoryCDOObject.cdoLockState();
- Assert.assertEquals(
- "new object " + category.getName()
- + (lockedByMe ? " should be locally locked" : " shouldn't be locally locked"),
- lockedByMe, cdoLockState.isLocked(LockType.WRITE, transaction, false));
-
- if (recursive)
- {
- for (Category subCategory : category.getCategories())
- {
- assertLockStatus(subCategory, lockedByMe, recursive);
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_387563_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_387563_Test.java
deleted file mode 100644
index 2a93570d3d..0000000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_387563_Test.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Esteban Dugueperoux - initial API and implementation
- */
-package org.eclipse.emf.cdo.tests.bugzilla;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
-import org.eclipse.emf.cdo.common.lock.CDOLockState;
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.tests.AbstractCDOTest;
-import org.eclipse.emf.cdo.tests.model1.Category;
-import org.eclipse.emf.cdo.tests.model1.Company;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CDOUtil;
-
-import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
-import org.eclipse.net4j.util.io.IOUtil;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author Esteban Dugueperoux
- */
-public class Bugzilla_387563_Test extends AbstractCDOTest
-{
- private CDOTransaction transaction;
-
- private Company company;
-
- private Category category1;
-
- private Category category2;
-
- private Category category3;
-
- private Category category4;
-
- private Category category5;
-
- @Override
- protected void doSetUp() throws Exception
- {
- super.doSetUp();
-
- CDOSession session = openSession();
- session.options().setLockNotificationMode(LockNotificationMode.ALWAYS);
-
- transaction = session.openTransaction();
- // transaction.options().setAutoReleaseLocksEnabled(false);
-
- CDOResource resource = transaction.createResource(getResourcePath("test1"));
-
- category1 = getModel1Factory().createCategory();
- category1.setName("category1");
-
- category2 = getModel1Factory().createCategory();
- category2.setName("category2");
-
- category3 = getModel1Factory().createCategory();
- category3.setName("category3");
-
- category4 = getModel1Factory().createCategory();
- category4.setName("category4");
-
- category5 = getModel1Factory().createCategory();
- category5.setName("category5");
-
- Category category6 = getModel1Factory().createCategory();
- category6.setName("category6");
-
- Category category7 = getModel1Factory().createCategory();
- category7.setName("category7");
-
- Category category8 = getModel1Factory().createCategory();
- category8.setName("category8");
-
- Category category9 = getModel1Factory().createCategory();
- category9.setName("category9");
-
- Category category10 = getModel1Factory().createCategory();
- category10.setName("category10");
-
- Category category11 = getModel1Factory().createCategory();
- category11.setName("category11");
-
- category1.getCategories().add(category2);
- category1.getCategories().add(category3);
- category2.getCategories().add(category4);
- category2.getCategories().add(category5);
- category3.getCategories().add(category8);
- category3.getCategories().add(category9);
- category4.getCategories().add(category6);
- category5.getCategories().add(category7);
- category8.getCategories().add(category10);
- category9.getCategories().add(category11);
-
- company = getModel1Factory().createCompany();
- company.getCategories().add(category1);
-
- resource.getContents().add(company);
-
- log("", Collections.singletonList(category1));
- }
-
- public void testPartialLockOnCommit() throws Exception
- {
- transaction.lockObjects(CDOUtil.getCDOObjects(category1), LockType.WRITE, DEFAULT_TIMEOUT, true);
-
- // Mark all objects to stay locked on commit
- transaction.options().addAutoReleaseLocksExemptions(true, category1);
- assertLockStatus(category1, true, true);
-
- // Mark category2 to be unlocked on commit
- transaction.options().removeAutoReleaseLocksExemptions(false, category2);
- assertLockStatus(category1, true, true);
-
- // Mark category3 and its descendants to be unlocked on commit
- transaction.options().removeAutoReleaseLocksExemptions(true, category3);
- assertLockStatus(category1, true, true);
-
- transaction.commit();
- assertLockStatus(category1, true, false);
- assertLockStatus(category2, false, false);
- assertLockStatus(category3, false, true);
- assertLockStatus(category4, true, true);
- assertLockStatus(category5, true, true);
- }
-
- public void testPartialUnlockOnCommit() throws Exception
- {
- transaction.lockObjects(CDOUtil.getCDOObjects(category1), LockType.WRITE, DEFAULT_TIMEOUT, true);
-
- // Mark category1 and its descendants to stay locked on commit
- transaction.options().addAutoReleaseLocksExemptions(true, category1);
- assertLockStatus(category1, true, true);
-
- transaction.unlockObjects(CDOUtil.getCDOObjects(category3), LockType.WRITE, true);
- assertLockStatus(category3, false, true);
-
- transaction.commit();
- assertLockStatus(category1, true, false);
- assertLockStatus(category2, true, true);
- assertLockStatus(category3, false, true);
- }
-
- private static void assertLockStatus(Category category, boolean expected, boolean recursive)
- {
- CDOObject cdoObject = CDOUtil.getCDOObject(category);
- CDOLockState lockState = cdoObject.cdoLockState();
-
- assertEquals(
- "new object " + category.getName() + (expected ? " should be locally locked" : " shouldn't be locally locked."),
- expected, lockState.isLocked(LockType.WRITE, cdoObject.cdoView(), false));
-
- if (recursive)
- {
- for (Category subCategory : category.getCategories())
- {
- assertLockStatus(subCategory, expected, recursive);
- }
- }
- }
-
- private static void log(String indent, List<Category> categories)
- {
- for (Category category : categories)
- {
- IOUtil.OUT().println(indent + category.getName() + " --> " + CDOUtil.getCDOObject(category).cdoID());
- log(indent + " ", category.getCategories());
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_387563b_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_387563b_Test.java
deleted file mode 100644
index 31baf15857..0000000000
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_387563b_Test.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2016 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.tests.bugzilla;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.common.lock.CDOLockState;
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.tests.AbstractLockingTest;
-import org.eclipse.emf.cdo.tests.model1.Company;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CDOUtil;
-
-/**
- * @author Eike Stepper
- */
-public class Bugzilla_387563b_Test extends AbstractLockingTest
-{
- public void testNoImplicitLockingOfNewObject() throws Exception
- {
- Company company = getModel1Factory().createCompany();
-
- CDOSession session = openSession();
- CDOTransaction transaction = session.openTransaction();
- transaction.options().setAutoReleaseLocksEnabled(true);
-
- CDOResource resource = transaction.createResource(getResourcePath("test1"));
- resource.getContents().add(company);
-
- CDOObject cdoObject = CDOUtil.getCDOObject(company);
- CDOLockState lockState = cdoObject.cdoLockState();
- assertNull(lockState.getWriteLockOwner());
-
- transaction.commit();
- assertWriteLock(false, company);
- }
-
- public void testExplicitLockingOfNewObject() throws Exception
- {
- Company company = getModel1Factory().createCompany();
-
- CDOSession session = openSession();
- CDOTransaction transaction = session.openTransaction();
- transaction.options().setAutoReleaseLocksEnabled(true);
-
- CDOResource resource = transaction.createResource(getResourcePath("test1"));
- resource.getContents().add(company);
-
- CDOObject cdoObject = CDOUtil.getCDOObject(company);
- cdoObject.cdoWriteLock().lock();
-
- CDOLockState lockState = cdoObject.cdoLockState();
- assertEquals(transaction, lockState.getWriteLockOwner());
-
- transaction.commit();
- assertWriteLock(false, company);
- }
-
- public void testExplicitLockingOfNewObjectExemption() throws Exception
- {
- Company company = getModel1Factory().createCompany();
-
- CDOSession session = openSession();
- CDOTransaction transaction = session.openTransaction();
- transaction.options().setAutoReleaseLocksEnabled(true);
- transaction.options().addAutoReleaseLocksExemptions(false, company);
-
- CDOResource resource = transaction.createResource(getResourcePath("test1"));
- resource.getContents().add(company);
-
- CDOObject cdoObject = CDOUtil.getCDOObject(company);
- cdoObject.cdoWriteLock().lock();
-
- CDOLockState lockState = cdoObject.cdoLockState();
- assertEquals(transaction, lockState.getWriteLockOwner());
-
- transaction.commit();
- assertWriteLock(true, company);
- }
-
- public void testExplicitLockingAndUnlockingOfNewObject() throws Exception
- {
- Company company = getModel1Factory().createCompany();
-
- CDOSession session = openSession();
- CDOTransaction transaction = session.openTransaction();
- transaction.options().setAutoReleaseLocksEnabled(true);
- transaction.options().addAutoReleaseLocksExemptions(false, company);
-
- CDOResource resource = transaction.createResource(getResourcePath("test1"));
- resource.getContents().add(company);
-
- CDOObject cdoObject = CDOUtil.getCDOObject(company);
- cdoObject.cdoWriteLock().lock();
-
- CDOLockState lockState = cdoObject.cdoLockState();
- assertEquals(transaction, lockState.getWriteLockOwner());
-
- cdoObject.cdoWriteLock().unlock();
- lockState = cdoObject.cdoLockState();
- assertNull(lockState.getWriteLockOwner());
-
- transaction.commit();
- assertWriteLock(false, company);
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_466951_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_466951_Test.java
index a6fcb011b5..0957d57d57 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_466951_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_466951_Test.java
@@ -28,6 +28,8 @@ import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.junit.Assert;
+
import java.util.Collections;
/**
@@ -54,78 +56,77 @@ public class Bugzilla_466951_Test extends AbstractCDOTest
ISignalProtocol<?> protocol = ((org.eclipse.emf.cdo.net4j.CDONet4jSession)session1).options().getNet4jProtocol();
SignalCounter signalCounter = new SignalCounter(protocol);
+ int nbLockStateRequest = signalCounter.getCountFor(LockStateRequest.class);
+ assertEquals(0, nbLockStateRequest);
+
+ CDOObject companyCDOObject = CDOUtil.getCDOObject(company);
+ CDOLockState lockState = companyCDOObject.cdoLockState();
+ Object expectedLockedObject = companyCDOObject.cdoID();
+ if (session1.getRepositoryInfo().isSupportingBranches())
+ {
+ expectedLockedObject = CDOIDUtil.createIDAndBranch(companyCDOObject.cdoID(), transaction1.getBranch());
+ }
+
+ assertEquals(expectedLockedObject, lockState.getLockedObject());
+ Assert.assertTrue(lockState.getReadLockOwners().isEmpty());
+ assertNull(lockState.getWriteLockOwner());
+ assertNull(lockState.getWriteOptionOwner());
- try
+ transaction1.lockObjects(Collections.singleton(companyCDOObject), LockType.WRITE, -1);
+
+ lockState = companyCDOObject.cdoLockState();
+ expectedLockedObject = companyCDOObject.cdoID();
+ if (session1.getRepositoryInfo().isSupportingBranches())
{
- assertEquals(0, signalCounter.removeCountFor(LockStateRequest.class));
-
- CDOObject companyCDOObject = CDOUtil.getCDOObject(company);
- CDOLockState lockState = companyCDOObject.cdoLockState();
- Object expectedLockedObject = companyCDOObject.cdoID();
- if (session1.getRepositoryInfo().isSupportingBranches())
- {
- expectedLockedObject = CDOIDUtil.createIDAndBranch(companyCDOObject.cdoID(), transaction1.getBranch());
- }
-
- assertEquals(expectedLockedObject, lockState.getLockedObject());
- assertTrue(lockState.getReadLockOwners().isEmpty());
- assertNull(lockState.getWriteLockOwner());
- assertNull(lockState.getWriteOptionOwner());
-
- transaction1.lockObjects(Collections.singleton(companyCDOObject), LockType.WRITE, -1);
-
- lockState = companyCDOObject.cdoLockState();
- expectedLockedObject = companyCDOObject.cdoID();
- if (session1.getRepositoryInfo().isSupportingBranches())
- {
- expectedLockedObject = CDOIDUtil.createIDAndBranch(companyCDOObject.cdoID(), transaction1.getBranch());
- }
-
- assertEquals(expectedLockedObject, lockState.getLockedObject());
- assertTrue(lockState.getReadLockOwners().isEmpty());
- assertEquals(transaction1, lockState.getWriteLockOwner());
- assertNull(lockState.getWriteOptionOwner());
-
- EcoreUtil.delete(company);
- assertEquals(CDOState.TRANSIENT, companyCDOObject.cdoState());
- lockState = companyCDOObject.cdoLockState();
- assertNull(lockState);
-
- Company company2 = getModel1Factory().createCompany();
- resource1.getContents().add(company2);
-
- CDOObject companyCDOObject2 = CDOUtil.getCDOObject(company2);
- lockState = companyCDOObject2.cdoLockState();
- expectedLockedObject = companyCDOObject2.cdoID();
- if (session1.getRepositoryInfo().isSupportingBranches())
- {
- expectedLockedObject = CDOIDUtil.createIDAndBranch(companyCDOObject2.cdoID(), transaction1.getBranch());
- }
-
- assertEquals(expectedLockedObject, lockState.getLockedObject());
- assertTrue(lockState.getReadLockOwners().isEmpty());
- assertNull(lockState.getWriteLockOwner());
- assertNull(lockState.getWriteOptionOwner());
- assertEquals(0, signalCounter.removeCountFor(LockStateRequest.class));
-
- transaction1.commit();
-
- lockState = companyCDOObject2.cdoLockState();
- expectedLockedObject = companyCDOObject2.cdoID();
- if (session1.getRepositoryInfo().isSupportingBranches())
- {
- expectedLockedObject = CDOIDUtil.createIDAndBranch(companyCDOObject2.cdoID(), transaction1.getBranch());
- }
-
- assertEquals(expectedLockedObject, lockState.getLockedObject());
- assertTrue(lockState.getReadLockOwners().isEmpty());
- assertNull(lockState.getWriteLockOwner());
- assertNull(lockState.getWriteOptionOwner());
- assertEquals(0, signalCounter.removeCountFor(LockStateRequest.class));
+ expectedLockedObject = CDOIDUtil.createIDAndBranch(companyCDOObject.cdoID(), transaction1.getBranch());
}
- finally
+
+ assertEquals(expectedLockedObject, lockState.getLockedObject());
+ Assert.assertTrue(lockState.getReadLockOwners().isEmpty());
+ assertEquals(transaction1, lockState.getWriteLockOwner());
+ assertNull(lockState.getWriteOptionOwner());
+
+ EcoreUtil.delete(company);
+ assertEquals(CDOState.TRANSIENT, companyCDOObject.cdoState());
+ lockState = companyCDOObject.cdoLockState();
+ assertNull(lockState);
+
+ Company company2 = getModel1Factory().createCompany();
+ resource1.getContents().add(company2);
+
+ CDOObject companyCDOObject2 = CDOUtil.getCDOObject(company2);
+ lockState = companyCDOObject2.cdoLockState();
+ expectedLockedObject = companyCDOObject2.cdoID();
+ if (session1.getRepositoryInfo().isSupportingBranches())
{
- signalCounter.dispose();
+ expectedLockedObject = CDOIDUtil.createIDAndBranch(companyCDOObject2.cdoID(), transaction1.getBranch());
}
+
+ assertEquals(expectedLockedObject, lockState.getLockedObject());
+ Assert.assertTrue(lockState.getReadLockOwners().isEmpty());
+ assertNull(lockState.getWriteLockOwner());
+ assertNull(lockState.getWriteOptionOwner());
+
+ nbLockStateRequest = signalCounter.getCountFor(LockStateRequest.class);
+ assertEquals(0, nbLockStateRequest);
+
+ transaction1.commit();
+
+ lockState = companyCDOObject2.cdoLockState();
+ expectedLockedObject = companyCDOObject2.cdoID();
+ if (session1.getRepositoryInfo().isSupportingBranches())
+ {
+ expectedLockedObject = CDOIDUtil.createIDAndBranch(companyCDOObject2.cdoID(), transaction1.getBranch());
+ }
+
+ assertEquals(expectedLockedObject, lockState.getLockedObject());
+ Assert.assertTrue(lockState.getReadLockOwners().isEmpty());
+ assertNull(lockState.getWriteLockOwner());
+ assertNull(lockState.getWriteOptionOwner());
+
+ nbLockStateRequest = signalCounter.getCountFor(LockStateRequest.class);
+ assertEquals(0, nbLockStateRequest);
+
+ protocol.removeListener(signalCounter);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
index 575ed4ced0..fc258b6e14 100644
--- a/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.ui;singleton:=true
-Bundle-Version: 4.5.100.qualifier
+Bundle-Version: 4.5.0.qualifier
Bundle-Activator: org.eclipse.emf.cdo.internal.ui.bundle.OM$Activator
Bundle-Vendor: %providerName
Bundle-ClassPath: .
@@ -27,7 +27,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";reso
org.eclipse.emf.ecp.edit;bundle-version="[1.5.0,2.0.0)";resolution:=optional,
org.eclipse.emf.ecp.edit.swt;bundle-version="[1.5.0,2.0.0)";resolution:=optional,
org.eclipse.emf.ecp.ui.view.swt;bundle-version="[1.5.0,2.0.0)";resolution:=optional
-Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
+Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -37,7 +37,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.actions;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.actions;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -47,7 +47,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.handlers;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.handlers;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -57,9 +57,9 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.actions.delegates;version="4.5.100";x-internal:=true,
- org.eclipse.emf.cdo.internal.ui.bundle;version="4.5.100";x-internal:=true,
- org.eclipse.emf.cdo.internal.ui.dialogs;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.actions.delegates;version="4.5.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.ui.bundle;version="4.5.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.ui.dialogs;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -69,7 +69,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.dnd;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.dnd;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -79,7 +79,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.editor;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.editor;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -89,7 +89,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.filters;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.filters;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -99,7 +99,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.history;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.history;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -109,7 +109,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.messages;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.messages;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -119,7 +119,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.perspectives;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.perspectives;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -129,7 +129,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.preferences;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.preferences;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -139,7 +139,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.transfer;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.transfer;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -149,7 +149,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.views;version="4.5.100";
+ org.eclipse.emf.cdo.internal.ui.views;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -159,5 +159,5 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.ui;version="4.5.100",
- org.eclipse.emf.cdo.ui.widgets;version="4.5.100"
+ org.eclipse.emf.cdo.ui;version="4.5.0",
+ org.eclipse.emf.cdo.ui.widgets;version="4.5.0"
diff --git a/plugins/org.eclipse.emf.cdo.ui/plugin.xml b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
index cdd6485193..3f9cb46f1e 100644
--- a/plugins/org.eclipse.emf.cdo.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
@@ -411,6 +411,7 @@
</iterate>
</with>
</visibleWhen>
+
</command>
<command
commandId="org.eclipse.emf.cdo.ui.UnlockObject"
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java
index 9966a073fd..0af905748a 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java
@@ -30,9 +30,7 @@ import java.util.List;
/**
* @author Simon McDuff
- * @deprecated As of 4.6 no longer supported.
*/
-@Deprecated
public abstract class AbstractLockObjectsAction extends EditingDomainAction
{
private List<InternalCDOObject> objects = new ArrayList<InternalCDOObject>();
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AutoReleaseLockExemptionAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AutoReleaseLockExemptionAction.java
deleted file mode 100644
index 794f1cf0a9..0000000000
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AutoReleaseLockExemptionAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2016 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.internal.ui.actions;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.internal.ui.messages.Messages;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.util.CDOUtil;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * @author Eike Stepper
- */
-public class AutoReleaseLockExemptionAction extends EditingDomainAction
-{
- public static final String ID = "AutoReleaseLockExemption"; //$NON-NLS-1$
-
- private static final String TITLE = Messages.getString("AutoReleaseLockExemptionAction.1"); //$NON-NLS-1$
-
- private CDOObject selectedObject;
-
- public AutoReleaseLockExemptionAction()
- {
- super(TITLE);
- setId(ID);
- }
-
- public void selectionChanged(IStructuredSelection selection)
- {
- selectedObject = null;
-
- if (selection != null && selection.size() == 1)
- {
- Object element = selection.getFirstElement();
- if (element instanceof EObject)
- {
- EObject object = (EObject)element;
- selectedObject = CDOUtil.getCDOObject(object);
- }
- }
- }
-
- public boolean init()
- {
- if (selectedObject != null && selectedObject.cdoWriteLock().isLocked())
- {
- CDOTransaction transaction = (CDOTransaction)selectedObject.cdoView();
- setChecked(transaction.options().isAutoReleaseLocksExemption(selectedObject));
- return true;
- }
-
- return false;
- }
-
- @Override
- public void update()
- {
- setEnabled(true);
- }
-
- @Override
- protected void doRun(IProgressMonitor progressMonitor) throws Exception
- {
- if (selectedObject != null)
- {
- CDOTransaction transaction = (CDOTransaction)selectedObject.cdoView();
- if (transaction.options().isAutoReleaseLocksExemption(selectedObject))
- {
- transaction.options().removeAutoReleaseLocksExemptions(false, selectedObject);
- }
- else
- {
- transaction.options().addAutoReleaseLocksExemptions(false, selectedObject);
- }
- }
-
- update();
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java
index ff5c91113b..b42596924f 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java
@@ -24,9 +24,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
* {@link CDOSession session}.
*
* @author Victor Roldan Betancort
- * @deprecated As of 4.6 no longer supported.
*/
-@Deprecated
public class ChangePassiveUpdateAction extends EditingDomainAction
{
public static final String ID = "change-passiveupdate"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java
index 707ccb2b26..b2be9b79c2 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java
@@ -19,9 +19,7 @@ import org.eclipse.emf.spi.cdo.InternalCDOObject;
/**
* @author Simon McDuff
- * @deprecated As of 4.6 no longer supported.
*/
-@Deprecated
public class ReadLockObjectsAction extends AbstractLockObjectsAction
{
public static final String ID = "readlock-objects"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java
index 3f418f7bc9..a96f14771d 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java
@@ -19,9 +19,7 @@ import org.eclipse.emf.spi.cdo.InternalCDOObject;
/**
* @author Simon McDuff
- * @deprecated As of 4.6 no longer supported.
*/
-@Deprecated
public class WriteLockObjectsAction extends AbstractLockObjectsAction
{
public static final String ID = "writelock-objects"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java
index 2e6e898465..f5977d7f87 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java
@@ -12,8 +12,12 @@
package org.eclipse.emf.cdo.internal.ui.editor;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.ui.actions.AutoReleaseLockExemptionAction;
+import org.eclipse.emf.cdo.internal.ui.actions.ChangePassiveUpdateAction;
import org.eclipse.emf.cdo.internal.ui.actions.ImportRootsAction;
+import org.eclipse.emf.cdo.internal.ui.actions.ReadLockObjectsAction;
+import org.eclipse.emf.cdo.internal.ui.actions.WriteLockObjectsAction;
+import org.eclipse.emf.cdo.internal.ui.messages.Messages;
+import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
import org.eclipse.emf.edit.domain.EditingDomain;
@@ -72,7 +76,17 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
/**
* @ADDED
*/
- protected AutoReleaseLockExemptionAction autoReleaseLockExemptionAction;
+ protected ReadLockObjectsAction readLockObjectsAction;
+
+ /**
+ * @ADDED
+ */
+ protected WriteLockObjectsAction writeLockObjectsAction;
+
+ /**
+ * @ADDED
+ */
+ protected ChangePassiveUpdateAction changePassiveUpdateAction;
/**
* This keeps track of the active editor.
@@ -182,7 +196,12 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
loadResourceAction.setId(LOAD_RESOURCE_ID);
importRootsAction = new ImportRootsAction();
- autoReleaseLockExemptionAction = new AutoReleaseLockExemptionAction();
+ importRootsAction.setId(ImportRootsAction.ID);
+
+ changePassiveUpdateAction = new ChangePassiveUpdateAction();
+
+ readLockObjectsAction = new ReadLockObjectsAction();
+ writeLockObjectsAction = new WriteLockObjectsAction();
validateAction = new ValidateAction();
controlAction = new ControlAction();
@@ -356,10 +375,18 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection)
{
- if (((IStructuredSelection)selection).size() == 1)
+ if (readLockObjectsAction != null)
{
- autoReleaseLockExemptionAction.selectionChanged((IStructuredSelection)selection);
+ readLockObjectsAction.selectionChanged((IStructuredSelection)selection);
+ }
+ if (writeLockObjectsAction != null)
+ {
+ writeLockObjectsAction.selectionChanged((IStructuredSelection)selection);
+ }
+
+ if (((IStructuredSelection)selection).size() == 1)
+ {
Object object = ((IStructuredSelection)selection).getFirstElement();
EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
@@ -367,13 +394,16 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
newChildDescriptors = domain.getNewChildDescriptors(object, null);
newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
- if (object instanceof CDOResource)
- {
- importRootsAction.setTargetResource((CDOResource)object);
- }
- else
+ if (importRootsAction != null)
{
- importRootsAction.setTargetResource(null);
+ if (object instanceof CDOResource)
+ {
+ importRootsAction.setTargetResource((CDOResource)object);
+ }
+ else
+ {
+ importRootsAction.setTargetResource(null);
+ }
}
}
}
@@ -548,21 +578,37 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
refreshViewerAction.setId(REFRESH_VIEWER_ID);
menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$
- if (autoReleaseLockExemptionAction.init())
- {
- menuManager.insertAfter("additions", autoReleaseLockExemptionAction); //$NON-NLS-1$
- autoReleaseLockExemptionAction.update();
- }
+ MenuManager lockingSubMenu = new MenuManager(Messages.getString("CDOActionBarContributor_0")); //$NON-NLS-1$
+ lockingSubMenu.add(new Separator("ui-actions")); //$NON-NLS-1$
+
+ lockingSubMenu.insertAfter("ui-actions", writeLockObjectsAction); //$NON-NLS-1$
+ writeLockObjectsAction.update();
+
+ lockingSubMenu.insertAfter("ui-actions", readLockObjectsAction); //$NON-NLS-1$
+ readLockObjectsAction.update();
+
+ menuManager.insertAfter("ui-actions", lockingSubMenu); //$NON-NLS-1$
+
+ menuManager.insertAfter("ui-actions", changePassiveUpdateAction); //$NON-NLS-1$
+ changePassiveUpdateAction.update();
+ changePassiveUpdateAction.setEnabled(true);
super.addGlobalActions(menuManager);
if (loadResourceAction != null)
{
- menuManager.insertAfter(loadResourceAction.getId(), importRootsAction);
+ if (importRootsAction != null)
+ {
+ menuManager.insertAfter(loadResourceAction.getId(), importRootsAction);
+ }
}
else
{
- menuManager.insertBefore("additions-end", importRootsAction); //$NON-NLS-1$
+ if (importRootsAction != null)
+ {
+ menuManager.insertBefore("additions-end", importRootsAction); //$NON-NLS-1$
+ }
+
menuManager.insertBefore("additions-end", new Separator()); //$NON-NLS-1$
}
}
@@ -585,15 +631,28 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
@Override
public void activate()
{
- importRootsAction.setActiveWorkbenchPart(activeEditor);
- Object input = ((CDOEditor)getActiveEditor()).getViewer().getInput();
- if (input instanceof CDOResource)
+ if (importRootsAction != null)
{
- importRootsAction.setTargetResource((CDOResource)input);
+ importRootsAction.setActiveWorkbenchPart(activeEditor);
+ Object input = ((CDOEditor)getActiveEditor()).getViewer().getInput();
+ if (input instanceof CDOResource)
+ {
+ importRootsAction.setTargetResource((CDOResource)input);
+ }
+ else
+ {
+ importRootsAction.setTargetResource(null);
+ }
}
- else
+
+ if (changePassiveUpdateAction != null)
{
- importRootsAction.setTargetResource(null);
+ Object input = ((CDOEditor)getActiveEditor()).getViewer().getInput();
+ if (input instanceof CDOResource)
+ {
+ CDOView view = ((CDOResource)input).cdoView();
+ changePassiveUpdateAction.setSession(view.getSession());
+ }
}
super.activate();
@@ -605,8 +664,11 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
@Override
public void deactivate()
{
- importRootsAction.setActiveWorkbenchPart(null);
- importRootsAction.setTargetResource(null);
+ if (importRootsAction != null)
+ {
+ importRootsAction.setActiveWorkbenchPart(null);
+ importRootsAction.setTargetResource(null);
+ }
super.deactivate();
}
@@ -618,6 +680,9 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
public void update()
{
super.update();
- importRootsAction.update();
+ if (importRootsAction != null)
+ {
+ importRootsAction.update();
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
index 0c5302e65c..6f4045eb55 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
@@ -91,7 +91,6 @@ CDOWatchListView.7=Remove all subscriptions
CDOWatchListView.8=Reset Changes
CDOWatchListView.9=Reset all change notifications from the selected subscriptions
ChangePassiveUpdateAction.1=Passive Updates
-AutoReleaseLockExemptionAction.1=Auto Release Lock Exemption
ChangePasswordAction_0=Change Password...
ChangePasswordAction_1=Change the connected user's password
CloseSessionAction.0=Close
diff --git a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
index 175d5a6fc3..f2978ba366 100644
--- a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo; singleton:=true
-Bundle-Version: 4.6.0.qualifier
+Bundle-Version: 4.5.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -10,29 +10,29 @@ Bundle-Activator: org.eclipse.emf.internal.cdo.bundle.Activator$Implementation
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";resolution:=optional,
org.eclipse.emf.cdo.common;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo;version="4.6.0",
- org.eclipse.emf.cdo.eresource;version="4.6.0",
- org.eclipse.emf.cdo.eresource.impl;version="4.6.0",
- org.eclipse.emf.cdo.eresource.util;version="4.6.0",
- org.eclipse.emf.cdo.eresource.validation;version="4.6.0",
- org.eclipse.emf.cdo.etypes;version="4.6.0",
- org.eclipse.emf.cdo.etypes.impl;version="4.6.0",
- org.eclipse.emf.cdo.etypes.util;version="4.6.0",
- org.eclipse.emf.cdo.session;version="4.6.0",
- org.eclipse.emf.cdo.session.remote;version="4.6.0",
- org.eclipse.emf.cdo.transaction;version="4.6.0",
- org.eclipse.emf.cdo.util;version="4.6.0",
- org.eclipse.emf.cdo.view;version="4.6.0",
- org.eclipse.emf.internal.cdo;version="4.6.0",
- org.eclipse.emf.internal.cdo.analyzer;version="4.6.0";
+Export-Package: org.eclipse.emf.cdo;version="4.5.0",
+ org.eclipse.emf.cdo.eresource;version="4.5.0",
+ org.eclipse.emf.cdo.eresource.impl;version="4.5.0",
+ org.eclipse.emf.cdo.eresource.util;version="4.5.0",
+ org.eclipse.emf.cdo.eresource.validation;version="4.5.0",
+ org.eclipse.emf.cdo.etypes;version="4.5.0",
+ org.eclipse.emf.cdo.etypes.impl;version="4.5.0",
+ org.eclipse.emf.cdo.etypes.util;version="4.5.0",
+ org.eclipse.emf.cdo.session;version="4.5.0",
+ org.eclipse.emf.cdo.session.remote;version="4.5.0",
+ org.eclipse.emf.cdo.transaction;version="4.5.0",
+ org.eclipse.emf.cdo.util;version="4.5.0",
+ org.eclipse.emf.cdo.view;version="4.5.0",
+ org.eclipse.emf.internal.cdo;version="4.5.0",
+ org.eclipse.emf.internal.cdo.analyzer;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.defs,
org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.bundle;version="4.6.0";x-friends:="org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.messages;version="4.6.0";x-internal:=true,
- org.eclipse.emf.internal.cdo.object;version="4.6.0";
+ org.eclipse.emf.internal.cdo.bundle;version="4.5.0";x-friends:="org.eclipse.emf.cdo.ui",
+ org.eclipse.emf.internal.cdo.messages;version="4.5.0";x-internal:=true,
+ org.eclipse.emf.internal.cdo.object;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -42,14 +42,14 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.0",
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.edit",
- org.eclipse.emf.internal.cdo.query;version="4.6.0";
+ org.eclipse.emf.internal.cdo.query;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.defs,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests.objectivity",
- org.eclipse.emf.internal.cdo.session;version="4.6.0";
+ org.eclipse.emf.internal.cdo.session;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -60,26 +60,26 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.0",
org.eclipse.emf.cdo.security.ui,
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.internal.cdo.session.remote;version="4.6.0";
+ org.eclipse.emf.internal.cdo.session.remote;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.defs,
org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.transaction;version="4.6.0";
+ org.eclipse.emf.internal.cdo.transaction;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.defs,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.internal.cdo.util;version="4.6.0";
+ org.eclipse.emf.internal.cdo.util;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.defs,
org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.view;version="4.6.0";
+ org.eclipse.emf.internal.cdo.view;version="4.5.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -88,5 +88,5 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.0",
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.spi.cdo;version="4.6.0"
+ org.eclipse.emf.spi.cdo;version="4.5.0"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.cdo/plugin.xml b/plugins/org.eclipse.emf.cdo/plugin.xml
index c8289c24b8..454a816c61 100644
--- a/plugins/org.eclipse.emf.cdo/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo/plugin.xml
@@ -59,19 +59,19 @@
id="org.eclipse.emf.cdo.view.properties"
type="org.eclipse.emf.cdo.view.CDOView"
namespace="org.eclipse.emf.cdo.view"
- properties="open,viewID,branchName,branch,timeStamp,lastUpdateTime,rootResourcePermission,readOnly,dirty,durable,sessionID,userID,userAuthenticated,historical,autoReleaseLocks"
+ properties="open,viewID,branchName,branch,timeStamp,lastUpdateTime,readOnly,dirty,durable,sessionID,userID,userAuthenticated,historical"
class="org.eclipse.emf.internal.cdo.view.ViewProperties$Tester"/>
<propertyTester
id="org.eclipse.emf.cdo.object.properties"
type="org.eclipse.emf.ecore.EObject"
namespace="org.eclipse.emf.cdo.object"
- properties="isCDO,id,version,branch,state,transactional,readable,writable,writableContainer,container,children,permission,permissionContainer,readLocks,readLocked,readLockedByOthers,writeLock,writeLocked,writeLockedByOthers,writeOption,writeOptioned,writeOptionedByOthers,autoReleaseLocksExemption,viewHistorical,uri"
+ properties="isCDO,id,version,branch,state,transactional,readable,writable,writableContainer,container,children,permission,permissionContainer,readLocks,readLocked,readLockedByOthers,writeLock,writeLocked,writeLockedByOthers,writeOption,writeOptioned,writeOptionedByOthers,viewHistorical,uri"
class="org.eclipse.emf.internal.cdo.object.ObjectProperties$Tester"/>
<propertyTester
id="org.eclipse.emf.cdo.object.properties"
type="org.eclipse.emf.cdo.CDOElement"
namespace="org.eclipse.emf.cdo.object"
- properties="isCDO,id,version,branch,state,transactional,readable,writable,writableContainer,container,children,permission,permissionContainer,readLocks,readLocked,readLockedByOthers,writeLock,writeLocked,writeLockedByOthers,writeOption,writeOptioned,writeOptionedByOthers,autoReleaseLocksExemption,viewHistorical,uri"
+ properties="isCDO,id,version,branch,state,transactional,readable,writable,writableContainer,container,children,permission,permissionContainer,readLocks,readLocked,readLockedByOthers,writeLock,writeLocked,writeLockedByOthers,writeOption,writeOptioned,writeOptionedByOthers,viewHistorical,uri"
class="org.eclipse.emf.internal.cdo.object.ObjectProperties$ElementTester"/>
</extension>
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOCommitContext.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOCommitContext.java
index 7bada9a363..4905d74085 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOCommitContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009-2012, 2014 Eike Stepper (Berlin, Germany) and others.
+ * Copyright (c) 2009-2012, 2014 Eike Stepper (Berlin, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -55,6 +55,11 @@ public interface CDOCommitContext
public CDOTransaction getTransaction();
/**
+ * @since 4.1
+ */
+ public boolean isAutoReleaseLocks();
+
+ /**
* @since 4.0
*/
public boolean isPartialCommit();
@@ -75,6 +80,11 @@ public interface CDOCommitContext
public List<CDOPackageUnit> getNewPackageUnits();
/**
+ * @since 4.1
+ */
+ public Collection<CDOLockState> getLocksOnNewObjects();
+
+ /**
* Returns a map of the new {@link CDOObject objects} that are to be committed with this commit context.
*/
public Map<CDOID, CDOObject> getNewObjects();
@@ -98,21 +108,4 @@ public interface CDOCommitContext
* @since 4.0
*/
public Collection<CDOLob<?>> getLobs();
-
- /**
- * @since 4.1
- * @deprecated As of 4.5 no longer supported. See {@link #getIDsToUnlock()}.
- */
- @Deprecated
- public boolean isAutoReleaseLocks();
-
- /**
- * @since 4.1
- */
- public Collection<CDOLockState> getLocksOnNewObjects();
-
- /**
- * @since 4.6
- */
- public Collection<CDOID> getIDsToUnlock();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java
index 2ed5ff400e..95d4460e3a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java
@@ -292,93 +292,24 @@ public interface CDOTransaction extends CDOView, CDOCommonTransaction, CDOUserTr
public void setStaleReferenceCleaner(CDOStaleReferenceCleaner staleReferenceCleaner);
/**
- * Returns <code>true</code> if locks in this transaction will be released when {@link CDOTransaction#commit()} or
- * {@link CDOTransaction#rollback()} are called, <code>false</code> otherwise.
+ * Returns true if locks in this view will be removes when {@link CDOTransaction#commit()} or
+ * {@link CDOTransaction#rollback()} is called.
* <p>
- * The default value is <code>true</code>.
- *
- * @see #getAutoReleaseLocksExemptions()
+ * Default value is true.
*/
public boolean isAutoReleaseLocksEnabled();
/**
- * Specifies whether locks in this transaction will be released when {@link CDOTransaction#commit()} or
- * {@link CDOTransaction#rollback()} are called.
+ * Specifies whether locks in this view will be removed when {@link CDOTransaction#commit()} or
+ * {@link CDOTransaction#rollback()} is called.
* <p>
- * If set to <code>false</code> all locks will be kept when {@link CDOTransaction#commit()} or
- * {@link CDOTransaction#rollback()} are called.
+ * If false all locks are kept.
* <p>
- * The default value is <code>true</code>.
- *
- * @see #getAutoReleaseLocksExemptions()
+ * Default value is true.
*/
public void setAutoReleaseLocksEnabled(boolean on);
/**
- * Returns the set of {@link EObject objects} that are to be treated as exemptions to the {@link #isAutoReleaseLocksEnabled()} option.
- * <p>
- * That means:
- * <p>
- * <ul>
- * <li> If {@link #isAutoReleaseLocksEnabled()} returns <code>true</code>, the locks on the objects in this set are <b>not</b> released
- * when {@link CDOTransaction#commit()} or {@link CDOTransaction#rollback()} are called.
- * <li> If {@link #isAutoReleaseLocksEnabled()} returns <code>false</code>, the locks on the objects in this set <b>are</b> released nevertheless
- * when {@link CDOTransaction#commit()} or {@link CDOTransaction#rollback()} are called.
- * </ul>
- * <p>
- * The returned set is unmodifiable. To modify the set use the {@link #clearAutoReleaseLocksExemptions() clearAutoReleaseLocksExemptions()},
- * {@link #addAutoReleaseLocksExemptions(boolean, EObject...) addAutoReleaseLocksExemption()},
- * and {@link #removeAutoReleaseLocksExemptions(boolean, EObject...) removeAutoReleaseLocksExemption()} methods.
- * <p>
- * <b>Implementation note</b>: This set stores weak references to the contained objects.
- *
- * @see #clearAutoReleaseLocksExemptions()
- * @see #addAutoReleaseLocksExemptions(boolean, EObject...)
- * @see #removeAutoReleaseLocksExemptions(boolean, EObject...)
- * @since 4.6
- */
- public Set<? extends EObject> getAutoReleaseLocksExemptions();
-
- /**
- * Returns <code>true</code> if the given object is treated as an exemption to the {@link #isAutoReleaseLocksEnabled()} option,
- * <code>false</code> otherwise.
- *
- * @see #getAutoReleaseLocksExemptions()
- * @since 4.6
- */
- public boolean isAutoReleaseLocksExemption(EObject object);
-
- /**
- * Clears the set of {@link EObject objects} that are to be treated as exemptions to the {@link #isAutoReleaseLocksEnabled()} option.
- *
- * @see #getAutoReleaseLocksExemptions()
- * @see #addAutoReleaseLocksExemptions(boolean, EObject...)
- * @see #removeAutoReleaseLocksExemptions(boolean, EObject...)
- * @since 4.6
- */
- public void clearAutoReleaseLocksExemptions();
-
- /**
- * Adds the given {@link EObject object} to the set of objects that are to be treated as exemptions to the {@link #isAutoReleaseLocksEnabled()} option.
- *
- * @see #getAutoReleaseLocksExemptions()
- * @see #clearAutoReleaseLocksExemptions()
- * @see #removeAutoReleaseLocksExemptions(boolean, EObject...)
- * @since 4.6
- */
- public void addAutoReleaseLocksExemptions(boolean recursive, EObject... objects);
-
- /**
- * Removes the given {@link EObject object} from the set of objects that are to be treated as exemptions to the {@link #isAutoReleaseLocksEnabled()} option.
- *
- * @see #getAutoReleaseLocksExemptions()
- * @see #clearAutoReleaseLocksExemptions()
- * @see #addAutoReleaseLocksExemptions(boolean, EObject...)
- * @since 4.6
- */
- public void removeAutoReleaseLocksExemptions(boolean recursive, EObject... objects);
-
- /**
* Returns the number of milliseconds to wait for the transaction update when {@link CDOTransaction#commit()} is called.
* <p>
* Default value is 10000.
@@ -436,8 +367,7 @@ public interface CDOTransaction extends CDOView, CDOCommonTransaction, CDOUserTr
/**
* An {@link IOptionsEvent options event} fired from transaction {@link CDOTransaction#options() options} when the
- * {@link Options#setAutoReleaseLocksEnabled(boolean) auto release locks enabled} or
- * {@link Options#getAutoReleaseLocksExemptions() auto release locks exemptions} options have changed.
+ * {@link Options#setAutoReleaseLocksEnabled(boolean) auto release locks} option has changed.
*
* @author Eike Stepper
* @since 3.0
@@ -446,31 +376,6 @@ public interface CDOTransaction extends CDOView, CDOCommonTransaction, CDOUserTr
*/
public interface AutoReleaseLocksEvent extends IOptionsEvent
{
- /**
- * An {@link AutoReleaseLocksEvent auto release locks options event} fired from transaction {@link CDOTransaction#options() options} when the
- * {@link Options#setAutoReleaseLocksEnabled(boolean) auto release locks enabled} option has changed.
- *
- * @author Eike Stepper
- * @since 4.6
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
- public interface AutoReleaseLocksEnabledEvent extends AutoReleaseLocksEvent
- {
- }
-
- /**
- * An {@link AutoReleaseLocksEvent auto release locks options event} fired from transaction {@link CDOTransaction#options() options} when the
- * {@link Options#getAutoReleaseLocksExemptions() auto release locks exemptions} option has changed.
- *
- * @author Eike Stepper
- * @since 4.6
- * @noextend This interface is not intended to be extended by clients.
- * @noimplement This interface is not intended to be implemented by clients.
- */
- public interface AutoReleaseLocksExemptionsEvent extends AutoReleaseLocksEvent
- {
- }
}
/**
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
index c6ec39bd64..41cd6b114b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
@@ -88,10 +88,8 @@ import org.eclipse.emf.spi.cdo.FSMUtil;
import org.eclipse.emf.spi.cdo.InternalCDOObject;
import org.eclipse.emf.spi.cdo.InternalCDOView;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.Lock;
@@ -594,20 +592,6 @@ public final class CDOUtil
}
/**
- * @since 4.6
- */
- public static List<? extends CDOObject> getCDOObjects(EObject... objects)
- {
- List<CDOObject> result = new ArrayList<CDOObject>();
- for (EObject object : objects)
- {
- result.add(getCDOObject(object));
- }
-
- return result;
- }
-
- /**
* @since 4.4
*/
public static boolean isCDOObject(EObject object)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index ff9c2cf322..2a6dc0f379 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -1635,7 +1635,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
* @author Eike Stepper
* @since 4.1
*/
- private final class CDOStoreEcoreEMap extends EcoreEMap<Object, Object> implements InternalCDOLoadable
+ private final class CDOStoreEcoreEMap extends EcoreEMap<Object, Object>implements InternalCDOLoadable
{
private static final long serialVersionUID = 1L;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/ObjectProperties.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/ObjectProperties.java
index 2cd24d3c3c..9f726b234e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/ObjectProperties.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/ObjectProperties.java
@@ -19,7 +19,6 @@ import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockState;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.security.CDOPermission;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.view.CDOView;
@@ -520,28 +519,6 @@ public class ObjectProperties extends Properties<EObject>
}
});
- add(new Property<EObject>("autoReleaseLocksExemption")//$NON-NLS-1$
- {
- @Override
- protected Object eval(EObject object)
- {
- CDOObject cdoObject = getCDOObject(object);
- if (cdoObject == null)
- {
- return false;
- }
-
- CDOView view = cdoObject.cdoView();
- if (view instanceof CDOTransaction)
- {
- CDOTransaction transaction = (CDOTransaction)view;
- return transaction.options().isAutoReleaseLocksExemption(cdoObject);
- }
-
- return false;
- }
- });
-
add(new Property<EObject>("viewHistorical") //$NON-NLS-1$
{
@Override
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 8c475d932f..c80de5cabe 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
@@ -96,8 +96,6 @@ import org.eclipse.emf.cdo.transaction.CDOMerger;
import org.eclipse.emf.cdo.transaction.CDOSavepoint;
import org.eclipse.emf.cdo.transaction.CDOStaleReferenceCleaner;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.transaction.CDOTransaction.Options.AutoReleaseLocksEvent.AutoReleaseLocksEnabledEvent;
-import org.eclipse.emf.cdo.transaction.CDOTransaction.Options.AutoReleaseLocksEvent.AutoReleaseLocksExemptionsEvent;
import org.eclipse.emf.cdo.transaction.CDOTransactionConflictEvent;
import org.eclipse.emf.cdo.transaction.CDOTransactionFinishedEvent;
import org.eclipse.emf.cdo.transaction.CDOTransactionHandler;
@@ -148,7 +146,6 @@ import org.eclipse.net4j.util.transaction.TransactionException;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
@@ -179,6 +176,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -189,7 +187,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import java.util.WeakHashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
@@ -3643,6 +3640,8 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
private CDOCommitData commitData;
+ private Collection<CDOLockState> locksOnNewObjects;
+
private Map<CDOID, CDOObject> newObjects;
private Map<CDOID, CDOObject> detachedObjects;
@@ -3653,10 +3652,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
private Map<ByteArrayWrapper, CDOLob<?>> lobs = new HashMap<ByteArrayWrapper, CDOLob<?>>();
- private List<CDOLockState> locksOnNewObjects = new ArrayList<CDOLockState>();
-
- private List<CDOID> idsToUnlock = new ArrayList<CDOID>();
-
public CDOCommitContextImpl(InternalCDOTransaction transaction)
{
this.transaction = transaction;
@@ -3665,8 +3660,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
private void calculateCommitData()
{
- OptionsImpl options = (OptionsImpl)transaction.options();
-
List<CDOPackageUnit> newPackageUnits = analyzeNewPackages();
newObjects = filterCommittables(transaction.getNewObjects());
@@ -3674,15 +3667,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
for (CDOObject newObject : newObjects.values())
{
revisions.add(newObject.cdoRevision());
-
- CDOLockState lockState = getLockState(newObject);
- if (lockState != null)
- {
- if (!options.isEffectiveAutoReleaseLock(newObject))
- {
- locksOnNewObjects.add(lockState);
- }
- }
}
revisionDeltas = filterCommittables(transaction.getRevisionDeltas());
@@ -3716,16 +3700,8 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
dirtyObjects = filterCommittables(transaction.getDirtyObjects());
- for (CDOObject lockedObject : getLockStates().keySet())
- {
- if (!FSMUtil.isTransient(lockedObject))
- {
- if (options.isEffectiveAutoReleaseLock(lockedObject))
- {
- idsToUnlock.add(lockedObject.cdoID());
- }
- }
- }
+ CDOLockState[] locksOnNewObjectsArray = getLockStates(newObjects.keySet(), false);
+ locksOnNewObjects = Arrays.asList(locksOnNewObjectsArray);
commitData = CDOCommitInfoUtil.createCommitData(newPackageUnits, revisions, deltas, detached);
}
@@ -3781,6 +3757,11 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
return isPartialCommit;
}
+ public boolean isAutoReleaseLocks()
+ {
+ return transaction.options().isAutoReleaseLocksEnabled();
+ }
+
public String getCommitComment()
{
return transaction.getCommitComment();
@@ -3806,6 +3787,11 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
return commitData.getNewPackageUnits();
}
+ public Collection<CDOLockState> getLocksOnNewObjects()
+ {
+ return locksOnNewObjects;
+ }
+
public Map<CDOID, CDOObject> getDetachedObjects()
{
return detachedObjects;
@@ -3821,22 +3807,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
return lobs.values();
}
- @Deprecated
- public boolean isAutoReleaseLocks()
- {
- return transaction.options().isAutoReleaseLocksEnabled();
- }
-
- public Collection<CDOLockState> getLocksOnNewObjects()
- {
- return locksOnNewObjects;
- }
-
- public List<CDOID> getIDsToUnlock()
- {
- return idsToUnlock;
- }
-
public void preCommit()
{
if (isDirty())
@@ -4021,26 +3991,10 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
fireEvent(new FinishedEvent(idMappings), listeners);
}
- Map<CDOObject, CDOLockState> lockStates = getLockStates();
- if (!lockStates.isEmpty())
+ CDOLockState[] newLockStates = result.getNewLockStates();
+ if (newLockStates != null)
{
- List<CDOLockState> objectsToUnlock = new ArrayList<CDOLockState>();
-
- for (Map.Entry<CDOObject, CDOLockState> entry : lockStates.entrySet())
- {
- CDOObject object = entry.getKey();
- if (options().isEffectiveAutoReleaseLock(object))
- {
- InternalCDOLockState lockState = (InternalCDOLockState)entry.getValue();
- lockState.updateFrom(InternalCDOLockState.UNLOCKED);
-
- objectsToUnlock.add(lockState);
- }
- }
-
- CDOLockState[] newLockStates = objectsToUnlock.toArray(new CDOLockState[objectsToUnlock.size()]);
- notifyOtherViewsAboutLockChanges(CDOLockChangeInfo.Operation.UNLOCK, null, result.getTimeStamp(),
- newLockStates);
+ updateAndNotifyLockStates(CDOLockChangeInfo.Operation.UNLOCK, null, result.getTimeStamp(), newLockStates);
}
}
catch (RuntimeException ex)
@@ -4221,14 +4175,12 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
private CDOUndoDetector undoDetector = DEFAULT_UNDO_DETECTOR;
- private final List<CDOConflictResolver> conflictResolvers = new ArrayList<CDOConflictResolver>();
+ private List<CDOConflictResolver> conflictResolvers = new ArrayList<CDOConflictResolver>();
private CDOStaleReferenceCleaner staleReferenceCleaner = CDOStaleReferenceCleaner.DEFAULT;
private boolean autoReleaseLocksEnabled = true;
- private final Map<EObject, Boolean> autoReleaseLocksExemptions = new WeakHashMap<EObject, Boolean>();
-
private long commitInfoTimeout = DEFAULT_COMMIT_INFO_TIMEOUT;
public OptionsImpl()
@@ -4462,67 +4414,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
if (autoReleaseLocksEnabled != on)
{
autoReleaseLocksEnabled = on;
- event = new AutoReleaseLocksEnabledEventImpl();
- }
- }
- finally
- {
- unlockView();
- }
- }
-
- fireEvent(event);
- }
-
- public Set<? extends EObject> getAutoReleaseLocksExemptions()
- {
- synchronized (getViewMonitor())
- {
- lockView();
-
- try
- {
- return new HashSet<EObject>(autoReleaseLocksExemptions.keySet());
- }
- finally
- {
- unlockView();
- }
- }
- }
-
- public boolean isAutoReleaseLocksExemption(EObject object)
- {
- synchronized (getViewMonitor())
- {
- lockView();
-
- try
- {
- return autoReleaseLocksExemptions.get(CDOUtil.getCDOObject(object)) == Boolean.TRUE;
- }
- finally
- {
- unlockView();
- }
- }
- }
-
- public void clearAutoReleaseLocksExemptions()
- {
- checkActive();
-
- IEvent event = null;
- synchronized (getViewMonitor())
- {
- lockView();
-
- try
- {
- if (!autoReleaseLocksExemptions.isEmpty())
- {
- autoReleaseLocksExemptions.clear();
- event = new AutoReleaseLocksExemptionsEventImpl();
+ event = new AutoReleaseLocksEventImpl();
}
}
finally
@@ -4534,97 +4426,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
fireEvent(event);
}
- public void addAutoReleaseLocksExemptions(boolean recursive, EObject... objects)
- {
- checkActive();
-
- IEvent event = null;
- synchronized (getViewMonitor())
- {
- lockView();
-
- try
- {
- for (EObject object : objects)
- {
- if (autoReleaseLocksExemptions.put(CDOUtil.getCDOObject(object), Boolean.TRUE) == null)
- {
- event = new AutoReleaseLocksExemptionsEventImpl();
- }
-
- if (recursive)
- {
- for (TreeIterator<EObject> it = object.eAllContents(); it.hasNext();)
- {
- EObject child = it.next();
- if (autoReleaseLocksExemptions.put(CDOUtil.getCDOObject(child), Boolean.TRUE) == null && event == null)
- {
- event = new AutoReleaseLocksExemptionsEventImpl();
- }
- }
- }
- }
- }
- finally
- {
- unlockView();
- }
- }
-
- fireEvent(event);
- }
-
- public void removeAutoReleaseLocksExemptions(boolean recursive, EObject... objects)
- {
- checkActive();
-
- IEvent event = null;
- synchronized (getViewMonitor())
- {
- lockView();
-
- try
- {
- for (EObject object : objects)
- {
- if (autoReleaseLocksExemptions.remove(CDOUtil.getCDOObject(object)) != null)
- {
- event = new AutoReleaseLocksExemptionsEventImpl();
- }
-
- if (recursive)
- {
- for (TreeIterator<EObject> it = object.eAllContents(); it.hasNext();)
- {
- EObject child = it.next();
- if (autoReleaseLocksExemptions.remove(CDOUtil.getCDOObject(child)) != null && event == null)
- {
- event = new AutoReleaseLocksExemptionsEventImpl();
- }
- }
- }
- }
- }
- finally
- {
- unlockView();
- }
- }
-
- fireEvent(event);
- }
-
- public boolean isEffectiveAutoReleaseLock(CDOObject newObject)
- {
- boolean effectiveAutoReleaseLock = autoReleaseLocksEnabled;
- if (autoReleaseLocksExemptions.containsKey(newObject))
- {
- effectiveAutoReleaseLock = !effectiveAutoReleaseLock;
- }
-
- return effectiveAutoReleaseLock;
- }
-
public long getCommitInfoTimeout()
{
return commitInfoTimeout;
@@ -4698,25 +4499,11 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
/**
* @author Eike Stepper
*/
- private final class AutoReleaseLocksEnabledEventImpl extends OptionsEvent implements AutoReleaseLocksEnabledEvent
- {
- private static final long serialVersionUID = 1L;
-
- public AutoReleaseLocksEnabledEventImpl()
- {
- super(OptionsImpl.this);
- }
- }
-
- /**
- * @author Eike Stepper
- */
- private final class AutoReleaseLocksExemptionsEventImpl extends OptionsEvent
- implements AutoReleaseLocksExemptionsEvent
+ private final class AutoReleaseLocksEventImpl extends OptionsEvent implements AutoReleaseLocksEvent
{
private static final long serialVersionUID = 1L;
- public AutoReleaseLocksExemptionsEventImpl()
+ public AutoReleaseLocksEventImpl()
{
super(OptionsImpl.this);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOUndoDetectorImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOUndoDetectorImpl.java
index 3f29900393..eb1fe86189 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOUndoDetectorImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOUndoDetectorImpl.java
@@ -94,7 +94,7 @@ public class CDOUndoDetectorImpl implements CDOUndoDetector
}
/**
- * @deprecated As of 4.5 {@link #detectUndo(CDOTransaction, CDORevision, CDORevision, CDOFeatureDelta)} is called.
+ * @deprecated As of CDO 4.5 {@link #detectUndo(CDOTransaction, CDORevision, CDORevision, CDOFeatureDelta)} is called.
*/
@Deprecated
protected boolean detectUndoContainer(InternalCDORevision cleanRevision, InternalCDORevision currentRevision)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
index 0f1dd2fba3..e475279359 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
@@ -119,6 +119,11 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext
return delegateCommitContext.getTransaction();
}
+ public boolean isAutoReleaseLocks()
+ {
+ return delegateCommitContext.isAutoReleaseLocks();
+ }
+
public boolean isPartialCommit()
{
return delegateCommitContext.isPartialCommit();
@@ -154,6 +159,11 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext
return delegateCommitContext.getNewPackageUnits();
}
+ public Collection<CDOLockState> getLocksOnNewObjects()
+ {
+ return delegateCommitContext.getLocksOnNewObjects();
+ }
+
public Map<CDOID, CDOObject> getDetachedObjects()
{
return delegateCommitContext.getDetachedObjects();
@@ -169,22 +179,6 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext
return delegateCommitContext.getLobs();
}
- @Deprecated
- public boolean isAutoReleaseLocks()
- {
- return delegateCommitContext.isAutoReleaseLocks();
- }
-
- public Collection<CDOLockState> getLocksOnNewObjects()
- {
- return delegateCommitContext.getLocksOnNewObjects();
- }
-
- public Collection<CDOID> getIDsToUnlock()
- {
- return delegateCommitContext.getIDsToUnlock();
- }
-
public Object call() throws Exception
{
state.handle(this, progressMonitor);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 814dcf43a3..694efefc37 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -99,7 +99,6 @@ import org.eclipse.net4j.util.ref.ReferenceValueMap;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -122,7 +121,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -363,16 +361,6 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
{
CDOLockState lockState = createUpdatedLockStateForNewObject(object, lockType, true);
locksOnNewObjects.add(lockState);
-
- if (recursive)
- {
- for (TreeIterator<EObject> it = object.eAllContents(); it.hasNext();)
- {
- CDOObject child = CDOUtil.getCDOObject(it.next());
- lockState = createUpdatedLockStateForNewObject(child, lockType, true);
- locksOnNewObjects.add(lockState);
- }
- }
}
else
{
@@ -441,13 +429,8 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
}
}
- int locksOnNewObjectsCount = locksOnNewObjects.size();
- if (locksOnNewObjectsCount != 0)
- {
- CDOLockState[] locksOnNewObjectsArray = locksOnNewObjects.toArray(new CDOLockState[locksOnNewObjectsCount]);
- // updateLockStates(locksOnNewObjectsArray);
- updateAndNotifyLockStates(Operation.LOCK, lockType, getTimeStamp(), locksOnNewObjectsArray);
- }
+ CDOLockState[] locksOnNewObjectsArray = locksOnNewObjects.toArray(new CDOLockState[locksOnNewObjects.size()]);
+ updateLockStates(locksOnNewObjectsArray);
if (result != null)
{
@@ -526,8 +509,7 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
/**
* Notifies other views of lock changes performed in this view
*/
- protected void notifyOtherViewsAboutLockChanges(Operation op, LockType type, long timestamp,
- CDOLockState[] lockStates)
+ private void notifyOtherViewsAboutLockChanges(Operation op, LockType type, long timestamp, CDOLockState[] lockStates)
{
if (lockStates.length > 0)
{
@@ -655,16 +637,6 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
{
CDOLockState lockState = createUpdatedLockStateForNewObject(object, lockType, false);
locksOnNewObjects.add(lockState);
-
- if (recursive)
- {
- for (TreeIterator<EObject> it = object.eAllContents(); it.hasNext();)
- {
- CDOObject child = CDOUtil.getCDOObject(it.next());
- lockState = createUpdatedLockStateForNewObject(child, lockType, false);
- locksOnNewObjects.add(lockState);
- }
- }
}
else
{
@@ -1012,69 +984,83 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
try
{
- List<CDOLockState> result = new ArrayList<CDOLockState>();
- List<CDOLockState> lockStatesToUpdate = new ArrayList<CDOLockState>();
- Set<CDOID> missingIDs = new LinkedHashSet<CDOID>();
+ List<CDOID> missing = new LinkedList<CDOID>();
+ List<CDOLockState> lockStates = new LinkedList<CDOLockState>();
+ List<CDOLockState> locksOnNewObjects = new ArrayList<CDOLockState>(ids.size());
for (CDOID id : ids)
{
+ CDOLockState lockState = null;
InternalCDOObject object = getObject(id, false);
if (object != null)
{
- CDOLockState lockState = lockStates.get(object);
- if (lockState != null)
- {
- result.add(lockState);
- continue;
- }
-
- if (loadOnDemand && FSMUtil.isNew(object))
- {
- Object lockTarget = getLockTarget(this, id);
- CDOLockState newLockState = CDOLockUtil.createLockState(lockTarget);
-
- result.add(newLockState);
- lockStatesToUpdate.add(newLockState);
- continue;
- }
+ lockState = this.lockStates.get(object);
}
- missingIDs.add(id);
+ if (lockState != null)
+ {
+ lockStates.add(lockState);
+ }
+ else if (loadOnDemand && object != null && FSMUtil.isNew(object))
+ {
+ Object lockedObject = getLockTarget(object); // CDOID or CDOIDAndBranch
+ CDOLockState defaultLockState = CDOLockUtil.createLockState(lockedObject);
+ locksOnNewObjects.add(defaultLockState);
+ lockStates.add(defaultLockState);
+ }
+ else
+ {
+ missing.add(id);
+ }
}
- if (loadOnDemand && (!missingIDs.isEmpty() || ids.isEmpty()))
+ if (loadOnDemand && (missing.size() > 0 || ids.isEmpty()))
{
CDOSessionProtocol sessionProtocol = session.getSessionProtocol();
- CDOLockState[] loadedLockStates = sessionProtocol.getLockStates(viewID, missingIDs, CDOLockState.DEPTH_NONE);
-
+ CDOLockState[] loadedLockStates = sessionProtocol.getLockStates(viewID, missing, CDOLockState.DEPTH_NONE);
+ List<CDOLockState> newLockStateForCache = new ArrayList<CDOLockState>(
+ loadedLockStates.length + missing.size());
for (CDOLockState loadedLockState : loadedLockStates)
{
- result.add(loadedLockState);
- lockStatesToUpdate.add(loadedLockState);
+ lockStates.add(loadedLockState);
+ newLockStateForCache.add(loadedLockState);
- CDOID id = CDOIDUtil.getCDOID(loadedLockState.getLockedObject());
- if (id != null)
+ CDOID cdoID = CDOIDUtil.getCDOID(loadedLockState.getLockedObject());
+ if (cdoID != null)
{
- missingIDs.remove(id);
+ missing.remove(cdoID);
}
}
- for (CDOID missingID : missingIDs)
+ for (CDOID missingLockStateForCDOID : missing)
{
- Object lockTarget = getLockTarget(this, missingID);
- CDOLockState defaultLockState = CDOLockUtil.createLockState(lockTarget);
+ Object target;
- result.add(defaultLockState);
- lockStatesToUpdate.add(defaultLockState);
+ InternalCDOObject object = getObject(missingLockStateForCDOID, false);
+ if (object != null)
+ {
+ target = getLockTarget(object); // CDOID or CDOIDAndBranch
+ }
+ else
+ {
+ target = missingLockStateForCDOID;
+ }
+
+ CDOLockState defaultLockState = CDOLockUtil.createLockState(target);
+ lockStates.add(defaultLockState);
+ newLockStateForCache.add(defaultLockState);
}
- }
- if (!lockStatesToUpdate.isEmpty())
- {
- updateLockStates(lockStatesToUpdate.toArray(new CDOLockState[lockStatesToUpdate.size()]));
+ if (options().isLockNotificationEnabled())
+ {
+ updateLockStates(newLockStateForCache.toArray(new CDOLockState[newLockStateForCache.size()]));
+ }
}
- return result.toArray(new CDOLockState[result.size()]);
+ CDOLockState[] locksOnNewObjectsArray = locksOnNewObjects.toArray(new CDOLockState[locksOnNewObjects.size()]);
+ updateLockStates(locksOnNewObjectsArray);
+
+ return lockStates.toArray(new CDOLockState[lockStates.size()]);
}
finally
{
@@ -1093,11 +1079,6 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
return lockStates.get(object);
}
- protected Map<CDOObject, CDOLockState> getLockStates()
- {
- return lockStates;
- }
-
private CDOBranchPoint getBranchPointForID(CDOID id)
{
// If this view's timestamp is something other than UNSPECIFIED_DATE,
@@ -1841,12 +1822,8 @@ public class CDOViewImpl extends AbstractCDOView implements IExecutorServiceProv
}
CDOID id = object.cdoID();
- return getLockTarget(view, id);
- }
-
- protected static Object getLockTarget(CDOView view, CDOID id)
- {
- if (view.getSession().getRepositoryInfo().isSupportingBranches())
+ boolean branching = view.getSession().getRepositoryInfo().isSupportingBranches();
+ if (branching)
{
return CDOIDUtil.createIDAndBranch(id, view.getBranch());
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java
index 738e562ee5..70d0dc1fba 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java
@@ -13,7 +13,6 @@ package org.eclipse.emf.internal.cdo.view;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.net4j.util.StringUtil;
@@ -58,13 +57,13 @@ public class ViewProperties extends Properties<CDOView>
});
add(new Property<CDOView>("branchName") //$NON-NLS-1$
- {
+ {
@Override
protected Object eval(CDOView view)
{
return view.getBranch().getName();
}
- });
+ });
add(new Property<CDOView>("branch", //$NON-NLS-1$
"Branch", "The branch of this view.", CATEGORY_VIEW)
@@ -167,27 +166,13 @@ public class ViewProperties extends Properties<CDOView>
});
add(new Property<CDOView>("historical") //$NON-NLS-1$
- {
+ {
@Override
protected Object eval(CDOView view)
{
return view.getTimeStamp() != CDOBranchPoint.UNSPECIFIED_DATE;
}
- });
-
- add(new Property<CDOView>("autoReleaseLocks") //$NON-NLS-1$
- {
- @Override
- protected Object eval(CDOView view)
- {
- if (view instanceof CDOTransaction)
- {
- return ((CDOTransaction)view).options().isAutoReleaseLocksEnabled();
- }
-
- return false;
- }
- });
+ });
}
public static void main(String[] args)
diff --git a/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF
index 55a3c2dfb9..a1071bf9f4 100644
--- a/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j.util;singleton:=true
-Bundle-Version: 3.7.0.qualifier
+Bundle-Version: 3.6.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -15,34 +15,34 @@ Import-Package: org.eclipse.osgi.service.debug;version="[1.0.0,2.0.0)";resolutio
org.osgi.framework;version="[1.3.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)";resolution:=optional,
org.osgi.util.tracker;version="[1.3.0,2.0.0)";resolution:=optional
-Export-Package: org.eclipse.net4j.internal.util.bundle;version="3.7.0";x-friends:="org.eclipse.net4j.util.ui,org.eclipse.net4j.tests",
- org.eclipse.net4j.internal.util.container;version="3.7.0";x-friends:="org.eclipse.net4j.util.defs",
- org.eclipse.net4j.internal.util.factory;version="3.7.0";x-friends:="org.eclipse.net4j.util.defs",
- org.eclipse.net4j.internal.util.om;version="3.7.0";x-friends:="org.eclipse.net4j.util.defs",
- org.eclipse.net4j.internal.util.om.pref;version="3.7.0";x-friends:="org.eclipse.net4j.util.defs",
- org.eclipse.net4j.internal.util.table;version="3.7.0";x-internal:=true,
- org.eclipse.net4j.internal.util.test;version="3.7.0";x-friends:="org.eclipse.net4j.tests",
- org.eclipse.net4j.util;version="3.7.0",
- org.eclipse.net4j.util.cache;version="3.7.0",
- org.eclipse.net4j.util.collection;version="3.7.0",
- org.eclipse.net4j.util.concurrent;version="3.7.0",
- org.eclipse.net4j.util.confirmation;version="3.7.0",
- org.eclipse.net4j.util.container;version="3.7.0",
- org.eclipse.net4j.util.container.delegate;version="3.7.0",
- org.eclipse.net4j.util.event;version="3.7.0",
- org.eclipse.net4j.util.factory;version="3.7.0",
- org.eclipse.net4j.util.fsm;version="3.7.0",
- org.eclipse.net4j.util.io;version="3.7.0",
- org.eclipse.net4j.util.lifecycle;version="3.7.0",
- org.eclipse.net4j.util.om;version="3.7.0",
- org.eclipse.net4j.util.om.log;version="3.7.0",
- org.eclipse.net4j.util.om.monitor;version="3.7.0",
- org.eclipse.net4j.util.om.pref;version="3.7.0",
- org.eclipse.net4j.util.om.trace;version="3.7.0",
- org.eclipse.net4j.util.options;version="3.7.0",
- org.eclipse.net4j.util.properties;version="3.7.0",
- org.eclipse.net4j.util.ref;version="3.7.0",
- org.eclipse.net4j.util.registry;version="3.7.0",
- org.eclipse.net4j.util.security;version="3.7.0",
- org.eclipse.net4j.util.transaction;version="3.7.0"
+Export-Package: org.eclipse.net4j.internal.util.bundle;version="3.6.0";x-friends:="org.eclipse.net4j.util.ui,org.eclipse.net4j.tests",
+ org.eclipse.net4j.internal.util.container;version="3.6.0";x-friends:="org.eclipse.net4j.util.defs",
+ org.eclipse.net4j.internal.util.factory;version="3.6.0";x-friends:="org.eclipse.net4j.util.defs",
+ org.eclipse.net4j.internal.util.om;version="3.6.0";x-friends:="org.eclipse.net4j.util.defs",
+ org.eclipse.net4j.internal.util.om.pref;version="3.6.0";x-friends:="org.eclipse.net4j.util.defs",
+ org.eclipse.net4j.internal.util.table;version="3.6.0";x-internal:=true,
+ org.eclipse.net4j.internal.util.test;version="3.6.0";x-friends:="org.eclipse.net4j.tests",
+ org.eclipse.net4j.util;version="3.6.0",
+ org.eclipse.net4j.util.cache;version="3.6.0",
+ org.eclipse.net4j.util.collection;version="3.6.0",
+ org.eclipse.net4j.util.concurrent;version="3.6.0",
+ org.eclipse.net4j.util.confirmation;version="3.6.0",
+ org.eclipse.net4j.util.container;version="3.6.0",
+ org.eclipse.net4j.util.container.delegate;version="3.6.0",
+ org.eclipse.net4j.util.event;version="3.6.0",
+ org.eclipse.net4j.util.factory;version="3.6.0",
+ org.eclipse.net4j.util.fsm;version="3.6.0",
+ org.eclipse.net4j.util.io;version="3.6.0",
+ org.eclipse.net4j.util.lifecycle;version="3.6.0",
+ org.eclipse.net4j.util.om;version="3.6.0",
+ org.eclipse.net4j.util.om.log;version="3.6.0",
+ org.eclipse.net4j.util.om.monitor;version="3.6.0",
+ org.eclipse.net4j.util.om.pref;version="3.6.0",
+ org.eclipse.net4j.util.om.trace;version="3.6.0",
+ org.eclipse.net4j.util.options;version="3.6.0",
+ org.eclipse.net4j.util.properties;version="3.6.0",
+ org.eclipse.net4j.util.ref;version="3.6.0",
+ org.eclipse.net4j.util.registry;version="3.6.0",
+ org.eclipse.net4j.util.security;version="3.6.0",
+ org.eclipse.net4j.util.transaction;version="3.6.0"
Eclipse-BuddyPolicy: registered
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java
index 7e9e087bb2..6a3ff3a6a3 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/HashBag.java
@@ -57,20 +57,6 @@ public final class HashBag<T> implements Set<T>
return counter.getValue();
}
- /**
- * @since 3.7
- */
- public int removeCounterFor(T o)
- {
- Counter counter = map.remove(o);
- if (counter == null)
- {
- return 0;
- }
-
- return counter.getValue();
- }
-
public boolean add(T o)
{
return add(o, 1);
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWOLockManager.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWOLockManager.java
index 565ba7925d..437445d636 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWOLockManager.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWOLockManager.java
@@ -40,8 +40,6 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_CONCURRENCY, RWOLockManager.class);
- private static final ThreadLocal<Boolean> UNLOCK_ALL = new ThreadLocal<Boolean>();
-
private final List<LockState<OBJECT, CONTEXT>> EMPTY_RESULT = Collections.emptyList();
private final Map<OBJECT, LockState<OBJECT, CONTEXT>> objectToLockStateMap = createObjectToLocksMap();
@@ -108,7 +106,7 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
lock(type, context, Collections.singleton(objectToLock), timeout);
}
- public void unlock(LockType type, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)
+ public synchronized void unlock(LockType type, CONTEXT context, Collection<? extends OBJECT> objectsToUnlock)
{
unlock2(type, context, objectsToUnlock);
}
@@ -116,16 +114,55 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
public synchronized List<LockState<OBJECT, CONTEXT>> unlock2(CONTEXT context,
Collection<? extends OBJECT> objectsToUnlock)
{
- return unlock2(LockType.values(), context, objectsToUnlock);
- }
+ if (objectsToUnlock.isEmpty())
+ {
+ return EMPTY_RESULT;
+ }
- public synchronized List<LockState<OBJECT, CONTEXT>> unlock2(LockType type, CONTEXT context,
- Collection<? extends OBJECT> objectsToUnlock)
- {
- return unlock2(new LockType[] { type }, context, objectsToUnlock);
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Unlock : {0} --> {1}", objectsToUnlock, context); //$NON-NLS-1$
+ }
+
+ Set<LockState<OBJECT, CONTEXT>> lockStates = new HashSet<LockState<OBJECT, CONTEXT>>();
+
+ Iterator<? extends OBJECT> it = objectsToUnlock.iterator();
+ while (it.hasNext())
+ {
+ OBJECT o = it.next();
+ LockState<OBJECT, CONTEXT> lockState = objectToLockStateMap.get(o);
+
+ if (lockState == null)
+ {
+ continue;
+ }
+
+ for (LockType lockType : LockType.values())
+ {
+ while (lockState.canUnlock(lockType, context))
+ {
+ lockState.unlock(lockType, context);
+ lockStates.add(lockState);
+ }
+ }
+ }
+
+ for (LockState<OBJECT, CONTEXT> lockState : lockStates)
+ {
+ removeLockStateForContext(context, lockState);
+
+ if (lockState.hasNoLocks())
+ {
+ objectToLockStateMap.remove(lockState.getLockedObject());
+ }
+ }
+
+ notifyAll();
+
+ return new LinkedList<RWOLockManager.LockState<OBJECT, CONTEXT>>(lockStates);
}
- private List<LockState<OBJECT, CONTEXT>> unlock2(LockType[] types, CONTEXT context,
+ public synchronized List<LockState<OBJECT, CONTEXT>> unlock2(LockType type, CONTEXT context,
Collection<? extends OBJECT> objectsToUnlock)
{
if (objectsToUnlock.isEmpty())
@@ -135,34 +172,25 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
if (TRACER.isEnabled())
{
- TRACER.format("Unlock: {0} --> {1}", context, objectsToUnlock); //$NON-NLS-1$
+ TRACER.format("Unlock", objectsToUnlock, context); //$NON-NLS-1$
}
- Set<LockState<OBJECT, CONTEXT>> result = new HashSet<LockState<OBJECT, CONTEXT>>();
+ List<LockState<OBJECT, CONTEXT>> lockStates = new LinkedList<LockState<OBJECT, CONTEXT>>();
- for (OBJECT o : objectsToUnlock)
+ Iterator<? extends OBJECT> it = objectsToUnlock.iterator();
+ while (it.hasNext())
{
+ OBJECT o = it.next();
LockState<OBJECT, CONTEXT> lockState = objectToLockStateMap.get(o);
- if (lockState != null)
+ if (lockState != null && lockState.canUnlock(type, context))
{
- for (LockType type : types)
- {
- while (lockState.canUnlock(type, context))
- {
- lockState.unlock(type, context);
- result.add(lockState);
-
- if (UNLOCK_ALL.get() != Boolean.TRUE)
- {
- break;
- }
- }
- }
+ lockStates.add(lockState);
}
}
- for (LockState<OBJECT, CONTEXT> lockState : result)
+ for (LockState<OBJECT, CONTEXT> lockState : lockStates)
{
+ lockState.unlock(type, context);
if (!lockState.hasLocks(context))
{
removeLockStateForContext(context, lockState);
@@ -176,7 +204,7 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
notifyAll();
- return new LinkedList<RWOLockManager.LockState<OBJECT, CONTEXT>>(result);
+ return lockStates;
}
public synchronized void unlock(CONTEXT context)
@@ -201,11 +229,11 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
for (LockState<OBJECT, CONTEXT> lockState : lockStates)
{
- for (LockType type : LockType.values())
+ for (LockType lockType : LockType.values())
{
- while (lockState.hasLock(type, context, false))
+ while (lockState.hasLock(lockType, context, false))
{
- lockState.unlock(type, context);
+ lockState.unlock(lockType, context);
}
}
@@ -414,22 +442,6 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
wait(waitTime);
}
-
- }
-
- /**
- * @since 3.7
- */
- public static void setUnlockAll(boolean on)
- {
- if (on)
- {
- UNLOCK_ALL.set(Boolean.TRUE);
- }
- else
- {
- UNLOCK_ALL.remove();
- }
}
/**
@@ -470,7 +482,8 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
return lockedObject;
}
- public boolean hasLock(LockType type, CONTEXT view, boolean byOthers)
+ public boolean hasLock(org.eclipse.net4j.util.concurrent.IRWLockManager.LockType type, CONTEXT view,
+ boolean byOthers)
{
CheckUtil.checkArg(view, "view");
@@ -504,7 +517,7 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
return false;
}
- public boolean hasLock(LockType type)
+ public boolean hasLock(org.eclipse.net4j.util.concurrent.IRWLockManager.LockType type)
{
switch (type)
{
@@ -521,49 +534,6 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
return false;
}
- public Set<CONTEXT> getReadLockOwners()
- {
- return Collections.unmodifiableSet(readLockOwners);
- }
-
- public CONTEXT getWriteLockOwner()
- {
- return writeLockOwner;
- }
-
- public CONTEXT getWriteOptionOwner()
- {
- return writeOptionOwner;
- }
-
- @Override
- public int hashCode()
- {
- return lockedObject.hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- {
- return true;
- }
-
- if (obj == null)
- {
- return false;
- }
-
- if (!(obj instanceof LockState))
- {
- return false;
- }
-
- LockState<?, ?> other = (LockState<?, ?>)obj;
- return lockedObject.equals(other.lockedObject);
- }
-
@Override
public String toString()
{
@@ -838,5 +808,20 @@ public class RWOLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWOLo
{
writeOptionOwner = null;
}
+
+ public Set<CONTEXT> getReadLockOwners()
+ {
+ return Collections.unmodifiableSet(readLockOwners);
+ }
+
+ public CONTEXT getWriteLockOwner()
+ {
+ return writeLockOwner;
+ }
+
+ public CONTEXT getWriteOptionOwner()
+ {
+ return writeOptionOwner;
+ }
}
}
diff --git a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
index 4f83a32180..67e3c0df64 100644
--- a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j;singleton:=true
-Bundle-Version: 4.6.0.qualifier
+Bundle-Version: 4.5.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -11,7 +11,7 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)";visibility:=reexport
-Export-Package: org.eclipse.internal.net4j;version="4.6.0";
+Export-Package: org.eclipse.internal.net4j;version="4.5.0";
x-friends:="org.eclipse.net4j.http.server,
org.eclipse.net4j.jvm,
org.eclipse.net4j.tcp,
@@ -20,7 +20,7 @@ Export-Package: org.eclipse.internal.net4j;version="4.6.0";
org.eclipse.net4j.http.tests,
org.eclipse.net4j.tests,
org.eclipse.net4j.defs",
- org.eclipse.internal.net4j.buffer;version="4.6.0";
+ org.eclipse.internal.net4j.buffer;version="4.5.0";
x-friends:="org.eclipse.net4j.http.server,
org.eclipse.net4j.jvm,
org.eclipse.net4j.tcp,
@@ -29,17 +29,17 @@ Export-Package: org.eclipse.internal.net4j;version="4.6.0";
org.eclipse.net4j.http.tests,
org.eclipse.net4j.tests,
org.eclipse.net4j.defs",
- org.eclipse.internal.net4j.bundle;version="4.6.0";x-internal:=true,
- org.eclipse.net4j;version="4.6.0",
- org.eclipse.net4j.acceptor;version="4.6.0",
- org.eclipse.net4j.buffer;version="4.6.0",
- org.eclipse.net4j.channel;version="4.6.0",
- org.eclipse.net4j.connector;version="4.6.0",
- org.eclipse.net4j.protocol;version="4.6.0",
- org.eclipse.net4j.signal;version="4.6.0",
- org.eclipse.net4j.signal.confirmation;version="4.6.0",
- org.eclipse.net4j.signal.heartbeat;version="4.6.0",
- org.eclipse.net4j.signal.security;version="4.6.0",
- org.eclipse.net4j.signal.wrapping;version="4.6.0",
- org.eclipse.spi.net4j;version="4.6.0"
+ org.eclipse.internal.net4j.bundle;version="4.5.0";x-internal:=true,
+ org.eclipse.net4j;version="4.5.0",
+ org.eclipse.net4j.acceptor;version="4.5.0",
+ org.eclipse.net4j.buffer;version="4.5.0",
+ org.eclipse.net4j.channel;version="4.5.0",
+ org.eclipse.net4j.connector;version="4.5.0",
+ org.eclipse.net4j.protocol;version="4.5.0",
+ org.eclipse.net4j.signal;version="4.5.0",
+ org.eclipse.net4j.signal.confirmation;version="4.5.0",
+ org.eclipse.net4j.signal.heartbeat;version="4.5.0",
+ org.eclipse.net4j.signal.security;version="4.5.0",
+ org.eclipse.net4j.signal.wrapping;version="4.5.0",
+ org.eclipse.spi.net4j;version="4.5.0"
Eclipse-BuddyPolicy: registered
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalCounter.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalCounter.java
index be525cbf09..7a5f654216 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalCounter.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalCounter.java
@@ -25,11 +25,8 @@ public final class SignalCounter implements IListener
{
private HashBag<Class<? extends Signal>> signals = new HashBag<Class<? extends Signal>>();
- private final ISignalProtocol<?> protocol;
-
public SignalCounter()
{
- protocol = null;
}
/**
@@ -37,25 +34,7 @@ public final class SignalCounter implements IListener
*/
public SignalCounter(ISignalProtocol<?> protocol)
{
- this.protocol = protocol;
-
- if (protocol != null)
- {
- protocol.addListener(this);
- }
- }
-
- /**
- * Get the number of different signal counted.
- *
- * @since 4.4
- */
- public int getCountForSignalTypes()
- {
- synchronized (signals)
- {
- return signals.size();
- }
+ protocol.addListener(this);
}
public int getCountFor(Class<? extends Signal> signal)
@@ -67,13 +46,15 @@ public final class SignalCounter implements IListener
}
/**
- * @since 4.6
+ * Get the number of different signal counted.
+ *
+ * @since 4.4
*/
- public int removeCountFor(Class<? extends Signal> signal)
+ public int getCountForSignalTypes()
{
synchronized (signals)
{
- return signals.removeCounterFor(signal);
+ return signals.size();
}
}
@@ -96,15 +77,4 @@ public final class SignalCounter implements IListener
}
}
}
-
- /**
- * @since 4.6
- */
- public void dispose()
- {
- if (protocol != null)
- {
- protocol.removeListener(this);
- }
- }
}

Back to the top