Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-11-10 03:29:25 -0500
committerEike Stepper2009-11-10 03:29:25 -0500
commitdfc7334a97b776c4b0433de4223967bc3cfd7dcb (patch)
tree0f8b47bf2e973b6b576511a8c08c6e9df40a33cd /plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction
parent7b940c06898e45a76b9fd652780b490e0dad64c5 (diff)
downloadcdo-dfc7334a97b776c4b0433de4223967bc3cfd7dcb.tar.gz
cdo-dfc7334a97b776c4b0433de4223967bc3cfd7dcb.tar.xz
cdo-dfc7334a97b776c4b0433de4223967bc3cfd7dcb.zip
[294700] Thread sync problem between CDOTransactionImpl.commit() and CDOSessionImpl.handleCommitNotification()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=294700
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.java77
1 files changed, 25 insertions, 52 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 d664d9ce5a..115d483c5e 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
@@ -633,34 +633,36 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
public void commit(IProgressMonitor progressMonitor) throws TransactionException
{
checkActive();
- getLock().lock();
-
- try
+ // TODO Consider fixing Bug 294700 without this commit lock.
+ synchronized (getSession().getCommitLock())
{
- if (hasConflict())
+ getLock().lock();
+
+ try
{
- throw new TransactionException(Messages.getString("CDOTransactionImpl.2")); //$NON-NLS-1$
- }
+ if (hasConflict())
+ {
+ throw new TransactionException(Messages.getString("CDOTransactionImpl.2")); //$NON-NLS-1$
+ }
+ if (progressMonitor == null)
+ {
+ progressMonitor = new NullProgressMonitor();
+ }
- if (progressMonitor == null)
+ getTransactionStrategy().commit(this, progressMonitor);
+ }
+ catch (TransactionException ex)
{
- progressMonitor = new NullProgressMonitor();
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new TransactionException(ex);
+ }
+ finally
+ {
+ getLock().unlock();
}
-
- // TTT convertDanglingObjects();
- getTransactionStrategy().commit(this, progressMonitor);
- }
- catch (TransactionException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new TransactionException(ex);
- }
- finally
- {
- getLock().unlock();
}
}
@@ -669,35 +671,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
commit(null);
}
- // TTT private void convertDanglingObjects()
- // {
- // for (CDOIDDanglingImpl id : danglingObjects.values())
- // {
- //
- // for (Reference reference : id.getReferences())
- // {
- // convertDanglingObject(reference.getSourceObject(), reference.getSourceFeature(), id);
- // }
- // }
- // }
- //
- // private void convertDanglingObject(CDOObject object, EStructuralFeature feature, CDOIDDangling id)
- // {
- // InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
- // Object value = revision.getValue(feature);
- // if (value instanceof List<?>)
- // {
- // List<?> list = (List<?>)value;
- // for (int i = 0; i < list.size(); i++)
- // {
- // if (list.get(i) == id)
- // {
- //
- // }
- // }
- // }
- // }
-
/**
* @since 2.0
*/

Back to the top