summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-19 13:52:30 (EST)
committerEike Stepper2008-01-19 13:52:30 (EST)
commit7a75c19c087b681357b2bc245d14d6685554b37f (patch)
tree2c1b8f989b52a34b9f4f9759dc76ed456a6b441a
parent39eba0af546ee1c577a253cb62c3ae5845db2891 (diff)
downloadcdo-7a75c19c087b681357b2bc245d14d6685554b37f.zip
cdo-7a75c19c087b681357b2bc245d14d6685554b37f.tar.gz
cdo-7a75c19c087b681357b2bc245d14d6685554b37f.tar.bz2
[215891] Rollback after Reload doesn't work for transaction
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215891
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java26
2 files changed, 16 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java
index dc057c1..cbabbc3 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java
@@ -70,6 +70,7 @@ public class ReloadObjectsAction extends EditingDomainAction
if (!objects.isEmpty())
{
InternalCDOObject[] array = objects.toArray(new InternalCDOObject[objects.size()]);
+
CDOStateMachine.INSTANCE.reload(array);
IWorkbenchPage page = getPage();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index e583705..c583440 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -89,7 +89,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
init(CDOState.NEW, CDOEvent.READ, IGNORE);
init(CDOState.NEW, CDOEvent.WRITE, IGNORE);
init(CDOState.NEW, CDOEvent.INVALIDATE, FAIL);
- init(CDOState.NEW, CDOEvent.RELOAD, IGNORE);
+ init(CDOState.NEW, CDOEvent.RELOAD, FAIL);
init(CDOState.NEW, CDOEvent.COMMIT, new CommitTransition());
init(CDOState.NEW, CDOEvent.ROLLBACK, FAIL);
init(CDOState.NEW, CDOEvent.FINALIZE_ATTACH, FAIL);
@@ -129,7 +129,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
init(CDOState.CONFLICT, CDOEvent.READ, IGNORE);
init(CDOState.CONFLICT, CDOEvent.WRITE, IGNORE);
init(CDOState.CONFLICT, CDOEvent.INVALIDATE, IGNORE);
- init(CDOState.CONFLICT, CDOEvent.RELOAD, new ReloadTransition());
+ init(CDOState.CONFLICT, CDOEvent.RELOAD, FAIL);
init(CDOState.CONFLICT, CDOEvent.COMMIT, IGNORE);
init(CDOState.CONFLICT, CDOEvent.ROLLBACK, new RollbackTransition());
init(CDOState.CONFLICT, CDOEvent.FINALIZE_ATTACH, IGNORE);
@@ -196,17 +196,21 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
List<CDORevisionImpl> revised = new ArrayList<CDORevisionImpl>();
for (InternalCDOObject object : objects)
{
- CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
- if (revision.isCurrent())
- {
- revisions.add(revision);
- }
- else
+ CDOState state = object.cdoState();
+ if (state != CDOState.NEW && state != CDOState.CONFLICT)
{
- revised.add(revision);
- }
+ CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
+ if (revision.isCurrent())
+ {
+ revisions.add(revision);
+ }
+ else
+ {
+ revised.add(revision);
+ }
- ids.put(object.cdoID(), object);
+ ids.put(object.cdoID(), object);
+ }
}
try