Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-11-06 11:24:56 -0500
committerEike Stepper2009-11-06 11:24:56 -0500
commitf6e946e14ee16dc92497f6b07ba0db363e9369f7 (patch)
tree04be6a48b48f205e20dd5d954922caefe1668243 /plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction
parentb36fc794e5ae7af3b4faab09e52d216136ca53cd (diff)
downloadcdo-f6e946e14ee16dc92497f6b07ba0db363e9369f7.tar.gz
cdo-f6e946e14ee16dc92497f6b07ba0db363e9369f7.tar.xz
cdo-f6e946e14ee16dc92497f6b07ba0db363e9369f7.zip
[294441] Remote notifications corrupt ongoing commit operations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=294441
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java30
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java7
2 files changed, 27 insertions, 10 deletions
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 d7e7da77e7..ecdf2c7616 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
@@ -625,18 +625,20 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
public void commit(IProgressMonitor progressMonitor) throws TransactionException
{
checkActive();
- if (hasConflict())
- {
- throw new TransactionException(Messages.getString("CDOTransactionImpl.2")); //$NON-NLS-1$
- }
-
- if (progressMonitor == null)
- {
- progressMonitor = new NullProgressMonitor();
- }
+ getLock().lock();
try
{
+ if (hasConflict())
+ {
+ throw new TransactionException(Messages.getString("CDOTransactionImpl.2")); //$NON-NLS-1$
+ }
+
+ if (progressMonitor == null)
+ {
+ progressMonitor = new NullProgressMonitor();
+ }
+
// TTT convertDanglingObjects();
getTransactionStrategy().commit(this, progressMonitor);
}
@@ -648,6 +650,10 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
throw new TransactionException(ex);
}
+ finally
+ {
+ getLock().unlock();
+ }
}
public void commit() throws TransactionException
@@ -1439,6 +1445,12 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
Set<CDOIDAndVersion> dirtyIDs = new HashSet<CDOIDAndVersion>();
for (CDOObject dirtyObject : dirtyObjects.values())
{
+ CDOState cdoState = dirtyObject.cdoState();
+ if (cdoState != CDOState.CLEAN)
+ {
+ System.out.println(cdoState);
+ }
+
CDORevision revision = dirtyObject.cdoRevision();
CDOIDAndVersion dirtyID = CDOIDUtil.createIDAndVersion(revision.getID(), revision.getVersion() - 1);
dirtyIDs.add(dirtyID);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
index c4279d09ee..52363fdabb 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
@@ -91,7 +91,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
private boolean allRequestEnabled = true;
- private ExecutorService executorService = Executors.newFixedThreadPool(10);
+ private ExecutorService executorService = createExecutorService();
private Map<InternalCDOTransaction, CDOXACommitContextImpl> activeContext = new HashMap<InternalCDOTransaction, CDOXACommitContextImpl>();
@@ -380,6 +380,11 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
}
}
+ protected ExecutorService createExecutorService()
+ {
+ return Executors.newFixedThreadPool(10);
+ }
+
/**
* @author Simon McDuff
*/

Back to the top