Community
Participate
Working Groups
The state of an object could be changed at the same time by two different processes... We should verify that! Simon
The discussion from ancient times ;-( I still pretend that it's not good to operate with multiple threads on the same CDOView (including the objects of the view). Or do you mean concurrent access between exactly one client thread and exactly one framework thread?
(In reply to comment #1) > The discussion from ancient times ;-( > > I still pretend that it's not good to operate with multiple threads on the same > CDOView (including the objects of the view). > I know we do not agree on this one. I would say that our framework doesn't use always the same threads to do such things. (invalidation etc..) so it becomes really hard for the end-users to achieve that. I don't want to prevent concurrency into modifications of data... only that threads should be able to load objects at the same time and modify different objects at the same time.. > Or do you mean concurrent access between exactly one client thread and exactly > one framework thread? > At the moment, we could start to make sure the state is correct between - 1 end - user - Invalidation process - Conflicts - Rollback mechanisms. I expect that after we fix it... it will work for many threads at the same time.. (at one point.. CDO will have the same limit as EMF... I understand that a list cannot be modified at the same time by 2 processes) Simon
Can we close this bugs since the concurrency of the state machine was fixed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=266982 Simon
I think we should check concurrency in SAVEpoint when we rollback ? Others places ?
Created attachment 128851 [details] To be more complete
Here what I committed. I committed since it could freeze CDO. Basically the synchronized(objects) has been reduced! We cannot call the state machine inside a syncrhonized(objects)... Since the state machine could call back CDOVIew and block again.... The patch I submitted in this bugs still need to review. ### Eclipse Workspace Patch 1.0 #P org.eclipse.emf.cdo Index: src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java,v retrieving revision 1.9 diff -u -r1.9 CDOViewImpl.java --- src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java 15 Mar 2009 19:28:13 -0000 1.9 +++ src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java 15 Mar 2009 20:13:56 -0000 @@ -1072,23 +1072,24 @@ { for (CDOIDAndVersion dirtyOID : dirtyOIDs) { - InternalCDOObject dirtyObject; + InternalCDOObject dirtyObject = null; + // 258831 - Causes deadlock when introduce thread safe mechanisms in State machine. synchronized (objects) { dirtyObject = objects.get(dirtyOID.getID()); - if (dirtyObject != null) + } + if (dirtyObject != null) + { + CDOStateMachine.INSTANCE.invalidate(dirtyObject, dirtyOID.getVersion()); + dirtyObjects.add(dirtyObject); + if (dirtyObject.cdoConflict()) { - CDOStateMachine.INSTANCE.invalidate(dirtyObject, dirtyOID.getVersion()); - dirtyObjects.add(dirtyObject); - if (dirtyObject.cdoConflict()) + if (conflicts == null) { - if (conflicts == null) - { - conflicts = new HashSet<CDOObject>(); - } - - conflicts.add(dirtyObject); + conflicts = new HashSet<CDOObject>(); } + + conflicts.add(dirtyObject); } } }
Created attachment 128878 [details] Patch v2 Ready to be committed. Simon, Can you please add some JavaDoc to InternalCDOView.getStateLock() and explain how it differs from CDOView.getLock() ?
I will create a testcase for every cases that the state machine could be called. (read, write, reload, detach, etc..) That way we will be sure that we do not forget something.. like I did with reload! Simon
I added some comments. What left on this bug ? Add testcases! I will do so!
I'd like to see this bug RESOLVED ;-)
I will do my best!
Since I'm working in Concurrency in another bugs.. I will close the following.
Fix available in EMF CDO 2.0.0M7
Generally available.