summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-11-07 10:09:13 (EST)
committerEike Stepper2007-11-07 10:09:13 (EST)
commit7726e19ca0834ab1117003e08d35deea2c7ff020 (patch)
tree4d62f524317cc7040690789c7f4312bd52502942
parenta98533e794568b7a2fe000457f198e5b134404f3 (diff)
downloadcdo-7726e19ca0834ab1117003e08d35deea2c7ff020.zip
cdo-7726e19ca0834ab1117003e08d35deea2c7ff020.tar.gz
cdo-7726e19ca0834ab1117003e08d35deea2c7ff020.tar.bz2
[209036] Offer RollbackTransactionDialog on save conflict
https://bugs.eclipse.org/bugs/show_bug.cgi?id=209036
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch72
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/RollbackTransactionDialog.java178
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java11
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java77
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java4
12 files changed, 334 insertions, 124 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch b/plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch
index 1410130..8f627f5 100644
--- a/plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch
+++ b/plugins/org.eclipse.emf.cdo.ui/CDOClient1.launch
@@ -14,8 +14,8 @@
<stringAttribute key="location" value="${workspace_loc}/../cdo.client1"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosplash&#13;&#10;-console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
@@ -24,7 +24,7 @@
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
<stringAttribute key="selectedPlugin" value="org.eclipse.emf.cdo.server"/>
<stringAttribute key="selected_target_plugins" value="com.ibm.icu,com.jcraft.jsch,javax.servlet,javax.servlet.jsp,org.apache.ant,org.apache.commons.el,org.apache.commons.logging,org.apache.jasper,org.apache.lucene,org.apache.lucene.analysis,org.eclipse.ant.core,org.eclipse.ant.ui,org.eclipse.compare,org.eclipse.core.boot,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.databinding,org.eclipse.core.databinding.beans,org.eclipse.core.expressions,org.eclipse.core.filebuffers,org.eclipse.core.filesystem,org.eclipse.core.filesystem.win32.x86,org.eclipse.core.jobs,org.eclipse.core.net,org.eclipse.core.resources,org.eclipse.core.resources.compatibility,org.eclipse.core.resources.win32,org.eclipse.core.runtime,org.eclipse.core.runtime.compatibility,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.core.variables,org.eclipse.cvs,org.eclipse.cvs.source,org.eclipse.debug.core,org.eclipse.debug.ui,org.eclipse.emf,org.eclipse.emf.ant,org.eclipse.emf.cheatsheets,org.eclipse.emf.codegen,org.eclipse.emf.codegen.ecore,org.eclipse.emf.codegen.ecore.ui,org.eclipse.emf.codegen.ui,org.eclipse.emf.common,org.eclipse.emf.common.ui,org.eclipse.emf.commonj.sdo,org.eclipse.emf.converter,org.eclipse.emf.doc,org.eclipse.emf.ecore,org.eclipse.emf.ecore.change,org.eclipse.emf.ecore.change.edit,org.eclipse.emf.ecore.edit,org.eclipse.emf.ecore.editor,org.eclipse.emf.ecore.sdo,org.eclipse.emf.ecore.sdo.doc,org.eclipse.emf.ecore.sdo.edit,org.eclipse.emf.ecore.sdo.editor,org.eclipse.emf.ecore.sdo.source,org.eclipse.emf.ecore.xmi,org.eclipse.emf.edit,org.eclipse.emf.edit.ui,org.eclipse.emf.exporter,org.eclipse.emf.importer,org.eclipse.emf.importer.ecore,org.eclipse.emf.importer.java,org.eclipse.emf.importer.rose,org.eclipse.emf.mapping,org.eclipse.emf.mapping.ecore2ecore,org.eclipse.emf.mapping.ecore2ecore.editor,org.eclipse.emf.mapping.ecore2xml,org.eclipse.emf.mapping.ecore2xml.ui,org.eclipse.emf.mapping.ui,org.eclipse.emf.mapping.xsd2ecore,org.eclipse.emf.mapping.xsd2ecore.editor,org.eclipse.emf.source,org.eclipse.equinox.app,org.eclipse.equinox.common,org.eclipse.equinox.http.jetty,org.eclipse.equinox.http.registry,org.eclipse.equinox.http.servlet,org.eclipse.equinox.jsp.jasper,org.eclipse.equinox.jsp.jasper.registry,org.eclipse.equinox.launcher,org.eclipse.equinox.launcher.win32.win32.x86,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.help.appserver,org.eclipse.help.base,org.eclipse.help.ui,org.eclipse.help.webapp,org.eclipse.jdt,org.eclipse.jdt.compiler.apt,org.eclipse.jdt.compiler.tool,org.eclipse.jdt.core,org.eclipse.jdt.core.manipulation,org.eclipse.jdt.debug,org.eclipse.jdt.debug.ui,org.eclipse.jdt.doc.isv,org.eclipse.jdt.doc.user,org.eclipse.jdt.junit,org.eclipse.jdt.junit.runtime,org.eclipse.jdt.junit4.runtime,org.eclipse.jdt.launching,org.eclipse.jdt.source,org.eclipse.jdt.ui,org.eclipse.jface,org.eclipse.jface.databinding,org.eclipse.jface.text,org.eclipse.jsch.core,org.eclipse.ltk.core.refactoring,org.eclipse.ltk.ui.refactoring,org.eclipse.osgi,org.eclipse.osgi.services,org.eclipse.osgi.util,org.eclipse.pde,org.eclipse.pde.build,org.eclipse.pde.core,org.eclipse.pde.doc.user,org.eclipse.pde.junit.runtime,org.eclipse.pde.runtime,org.eclipse.pde.source,org.eclipse.pde.ui,org.eclipse.pde.ui.templates,org.eclipse.platform,org.eclipse.platform.doc.isv,org.eclipse.platform.source,org.eclipse.platform.source.win32.win32.x86,org.eclipse.rcp,org.eclipse.rcp.source,org.eclipse.rcp.source.win32.win32.x86,org.eclipse.sdk,org.eclipse.search,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.team.core,org.eclipse.team.cvs.core,org.eclipse.team.cvs.ssh,org.eclipse.team.cvs.ssh2,org.eclipse.team.cvs.ui,org.eclipse.team.ui,org.eclipse.text,org.eclipse.ui,org.eclipse.ui.browser,org.eclipse.ui.cheatsheets,org.eclipse.ui.console,org.eclipse.ui.editors,org.eclipse.ui.externaltools,org.eclipse.ui.forms,org.eclipse.ui.ide,org.eclipse.ui.ide.application,org.eclipse.ui.intro,org.eclipse.ui.intro.universal,org.eclipse.ui.navigator,org.eclipse.ui.navigator.resources,org.eclipse.ui.presentations.r21,org.eclipse.ui.views,org.eclipse.ui.views.properties.tabbed,org.eclipse.ui.win32,org.eclipse.ui.workbench,org.eclipse.ui.workbench.compatibility,org.eclipse.ui.workbench.texteditor,org.eclipse.update.configurator,org.eclipse.update.core,org.eclipse.update.core.win32,org.eclipse.update.scheduler,org.eclipse.update.ui,org.eclipse.xsd,org.eclipse.xsd.cheatsheets,org.eclipse.xsd.doc,org.eclipse.xsd.ecore.exporter,org.eclipse.xsd.ecore.importer,org.eclipse.xsd.edit,org.eclipse.xsd.editor,org.eclipse.xsd.source,org.junit,org.junit4,org.mortbay.jetty"/>
-<stringAttribute key="selected_workspace_plugins" value="org.eclipse.net4j.buddies,org.eclipse.emf.cdo.examples,org.eclipse.emf.cdo.tests.model1.edit,org.eclipse.net4j.util.ui,org.eclipse.net4j.tcp,org.eclipse.emf.cdo.doc,org.eclipse.net4j.ui,org.eclipse.emf.cdo.protocol,org.eclipse.net4j.buddies.ui,org.eclipse.ant.optional.junit,org.eclipse.net4j.chat,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.ui,org.eclipse.emf.cdo.edit,org.eclipse.net4j.buddies.protocol,org.eclipse.emf.cdo,org.eclipse.emf.cdo.weaver,org.eclipse.emf.cdo.tests.model1.editor,org.eclipse.emf.cdo.migrator,org.eclipse.net4j.chat.ui,org.eclipse.net4j,org.eclipse.emf.cdo.tests.model1,org.eclipse.emf.cdo.weaver.ui"/>
+<stringAttribute key="selected_workspace_plugins" value="org.eclipse.emf.cdo.protocol,org.eclipse.net4j.buddies.ui,org.eclipse.ant.optional.junit,org.eclipse.net4j.chat,org.eclipse.net4j.util,org.eclipse.emf.cdo.server,org.eclipse.emf.cdo.ui,org.eclipse.emf.cdo.edit,org.eclipse.net4j.buddies.protocol,org.eclipse.emf.cdo,org.eclipse.net4j.buddies,org.eclipse.emf.cdo.examples,org.eclipse.emf.cdo.weaver,org.eclipse.emf.cdo.tests.model1.editor,org.eclipse.emf.cdo.tests.model1.edit,org.eclipse.net4j.util.ui,org.eclipse.net4j.chat.ui,org.eclipse.net4j,org.eclipse.emf.cdo.tests.model1,org.eclipse.net4j.tcp,org.eclipse.emf.cdo.doc,org.eclipse.net4j.ui,org.eclipse.emf.cdo.weaver.ui"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="tracing" value="true"/>
<mapAttribute key="tracingOptions">
@@ -39,8 +39,8 @@
<mapEntry key="org.eclipse.ui/trace/contexts" value="false"/>
<mapEntry key="org.eclipse.debug.ui/debug/viewers/updateSequence" value="false"/>
<mapEntry key="org.eclipse.osgi/trace/filename" value="runtime.traces"/>
-<mapEntry key="org.eclipse.jdt.core/debug" value="true"/>
<mapEntry key="org.eclipse.debug.ui/debug/contextlaunching" value="false"/>
+<mapEntry key="org.eclipse.jdt.core/debug" value="true"/>
<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug" value="false"/>
<mapEntry key="org.eclipse.net4j.tcp/debug" value="true"/>
<mapEntry key="org.eclipse.team.cvs.core/dirtycaching" value="false"/>
@@ -53,8 +53,8 @@
<mapEntry key="org.eclipse.emf.cdo/debug.util" value="true"/>
<mapEntry key="org.eclipse.osgi/resolver/debug" value="false"/>
<mapEntry key="org.eclipse.team.core/refreshjob" value="false"/>
-<mapEntry key="org.eclipse.ui/debug" value="false"/>
<mapEntry key="org.eclipse.update.core/debug/installhandler" value="false"/>
+<mapEntry key="org.eclipse.ui/debug" value="false"/>
<mapEntry key="org.eclipse.help.ui/debug/infopop" value="false"/>
<mapEntry key="org.eclipse.pde.core/classpath" value="false"/>
<mapEntry key="org.eclipse.team.cvs.core/threading" value="false"/>
@@ -64,11 +64,11 @@
<mapEntry key="org.eclipse.ui/trace/operations.verbose" value="false"/>
<mapEntry key="org.eclipse.osgi/trace/activation" value="false"/>
<mapEntry key="org.eclipse.debug.core/debug/commands" value="false"/>
-<mapEntry key="org.eclipse.ui/perf/workbench.restore" value="30000"/>
<mapEntry key="org.eclipse.team.core/threading" value="false"/>
+<mapEntry key="org.eclipse.ui/perf/workbench.restore" value="30000"/>
<mapEntry key="org.eclipse.update.core/debug/parsing" value="false"/>
-<mapEntry key="org.eclipse.emf.cdo.protocol/debug.protocol" value="true"/>
<mapEntry key="org.eclipse.jdt.core/debug/postaction" value="false"/>
+<mapEntry key="org.eclipse.emf.cdo.protocol/debug.protocol" value="true"/>
<mapEntry key="org.eclipse.ui/trace/graphics" value="false"/>
<mapEntry key="org.eclipse.osgi/defaultprofile/logsynchronously" value="false"/>
<mapEntry key="org.eclipse.net4j.db/debug" value="true"/>
@@ -78,15 +78,15 @@
<mapEntry key="org.eclipse.debug.ui/debug" value="false"/>
<mapEntry key="org.eclipse.jdt.core/debug/buffermanager" value="false"/>
<mapEntry key="org.eclipse.help.base/debug/search" value="false"/>
-<mapEntry key="org.eclipse.jface.text/debug/ContentAssistSubjectAdapters" value="false"/>
<mapEntry key="org.eclipse.pde.build/debug" value="false"/>
+<mapEntry key="org.eclipse.jface.text/debug/ContentAssistSubjectAdapters" value="false"/>
<mapEntry key="org.eclipse.jdt.ui/perf/search/participants" value="300"/>
<mapEntry key="org.eclipse.ui/perf/perspective.create" value="800"/>
<mapEntry key="org.eclipse.net4j.buddies.protocol/debug" value="true"/>
<mapEntry key="org.eclipse.update.core/debug/type" value="false"/>
<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/platformadmin" value="false"/>
-<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPropertyChangeListener" value="false"/>
<mapEntry key="org.eclipse.osgi/resolver/generics" value="false"/>
+<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPropertyChangeListener" value="false"/>
<mapEntry key="org.eclipse.osgi/resolver/requires" value="false"/>
<mapEntry key="org.eclipse.core.resources/refresh" value="false"/>
<mapEntry key="org.eclipse.jdt.core/perf/containerinitializer" value="5000"/>
@@ -98,8 +98,8 @@
<mapEntry key="org.eclipse.ui/trace/handlers" value="false"/>
<mapEntry key="org.eclipse.ui/trace/contexts.performance" value="false"/>
<mapEntry key="org.eclipse.net4j.buddies/debug" value="true"/>
-<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/>
<mapEntry key="org.eclipse.jdt.core/perf/completion" value="300"/>
+<mapEntry key="org.eclipse.team.cvs.core/metafiles" value="false"/>
<mapEntry key="org.eclipse.osgi/profile/startup" value="false"/>
<mapEntry key="org.eclipse.core.jobs/jobs" value="false"/>
<mapEntry key="org.eclipse.core.resources/perf/save.participants" value="500"/>
@@ -113,11 +113,11 @@
<mapEntry key="org.eclipse.net4j/debug.buffer" value="false"/>
<mapEntry key="org.eclipse.core.resources/contenttype/cache" value="false"/>
<mapEntry key="org.eclipse.emf.cdo/debug.repository" value="true"/>
-<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/>
<mapEntry key="org.eclipse.core.jobs/jobs/locks" value="false"/>
+<mapEntry key="org.eclipse.update.core/debug/configuration" value="false"/>
<mapEntry key="org.eclipse.emf.cdo.examples/debug" value="true"/>
-<mapEntry key="org.eclipse.ui/trace/handlers.verbose.commandId" value=""/>
<mapEntry key="org.eclipse.core.runtime/url/debug/connect" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/handlers.verbose.commandId" value=""/>
<mapEntry key="org.eclipse.ui.ide/debug" value="false"/>
<mapEntry key="org.eclipse.osgi/profile/debug" value="false"/>
<mapEntry key="org.eclipse.pde.core/debug" value="true"/>
@@ -126,17 +126,17 @@
<mapEntry key="org.eclipse.net4j.util/debug.registry" value="true"/>
<mapEntry key="org.eclipse.jdt.ui/perf/explorer/createPartControl" value="1300"/>
<mapEntry key="org.eclipse.jdt.core/debug/hierarchy" value="false"/>
-<mapEntry key="org.eclipse.jdt.core/perf/variableinitializer" value="5000"/>
-<mapEntry key="org.eclipse.emf.cdo/debug.object" value="true"/>
<mapEntry key="org.eclipse.ui.ide/debug/internalerror/openDialog" value="false"/>
+<mapEntry key="org.eclipse.emf.cdo/debug.object" value="true"/>
+<mapEntry key="org.eclipse.jdt.core/perf/variableinitializer" value="5000"/>
<mapEntry key="org.eclipse.emf.cdo.server/debug.revision" value="false"/>
<mapEntry key="org.eclipse.core.resources/strings" value="false"/>
<mapEntry key="org.eclipse.jdt.core/debug/sourcemapper" value="false"/>
<mapEntry key="org.eclipse.core.resources/save/mastertable" value="false"/>
<mapEntry key="org.eclipse.core.expressions/tracePropertyResolving" value="false"/>
-<mapEntry key="org.eclipse.core.resources/preferences" value="false"/>
-<mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/>
<mapEntry key="org.eclipse.ui/perf/showHeapStatus" value="true"/>
+<mapEntry key="org.eclipse.jdt.core/debug/javadelta" value="false"/>
+<mapEntry key="org.eclipse.core.resources/preferences" value="false"/>
<mapEntry key="org.eclipse.jdt.core/debug/selection" value="false"/>
<mapEntry key="org.eclipse.jdt.ui/perf/content_assist_sorters/extensions" value=""/>
<mapEntry key="org.eclipse.jdt.core/debug/javamodel/cache" value="false"/>
@@ -147,26 +147,26 @@
<mapEntry key="org.eclipse.ui/perf/part.activate" value="200"/>
<mapEntry key="org.eclipse.update.core/debug" value="true"/>
<mapEntry key="org.eclipse.osgi/debug/security" value="false"/>
-<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/>
<mapEntry key="org.eclipse.core.resources/build/needbuild" value="false"/>
+<mapEntry key="org.eclipse.core.resources/restore/metainfo" value="false"/>
<mapEntry key="org.eclipse.core.resources/perf/builders" value="10000"/>
-<mapEntry key="org.eclipse.ui/perf/perspective.listeners" value="200"/>
<mapEntry key="org.eclipse.net4j.jms.admin/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.ui/perf/perspective.listeners" value="200"/>
<mapEntry key="org.eclipse.ui/debug/showAllJobs" value="false"/>
-<mapEntry key="org.eclipse.core.resources/history" value="false"/>
<mapEntry key="org.eclipse.emf.cdo.server/debug.store" value="true"/>
+<mapEntry key="org.eclipse.core.resources/history" value="false"/>
<mapEntry key="org.eclipse.ui/listeners/IWorkbenchPage.IPartListener" value="false"/>
<mapEntry key="org.eclipse.jdt.core/debug/search" value="false"/>
-<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/>
<mapEntry key="org.eclipse.pde.core/validation" value="false"/>
+<mapEntry key="org.eclipse.team.cvs.core/cvsprotocol" value="true"/>
<mapEntry key="org.eclipse.jface.text/debug/AnnotationPainter" value="false"/>
<mapEntry key="org.eclipse.core.resources/restore/mastertable" value="false"/>
<mapEntry key="org.eclipse.core.runtime/debug" value="false"/>
<mapEntry key="org.eclipse.equinox.preferences/set" value="false"/>
<mapEntry key="org.eclipse.core.resources/restore/snapshots" value="false"/>
<mapEntry key="org.eclipse.ui/perf/perspective.switch" value="800"/>
-<mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/>
<mapEntry key="org.eclipse.emf.cdo/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.help.webapp/debug/workingsets" value="false"/>
<mapEntry key="org.eclipse.osgi/debug/bundleTime" value="false"/>
<mapEntry key="org.eclipse.core.resources/restore/markers" value="false"/>
<mapEntry key="org.eclipse.ui/perf/workbench.start" value="45000"/>
@@ -177,11 +177,11 @@
<mapEntry key="org.eclipse.osgi/debug/startlevel" value="false"/>
<mapEntry key="org.eclipse.core.resources/restore" value="false"/>
<mapEntry key="org.eclipse.osgi/resolver/wiring" value="false"/>
-<mapEntry key="org.eclipse.core.resources/perf/snapshot" value="1000"/>
<mapEntry key="org.eclipse.net4j.buddies.server/debug" value="true"/>
+<mapEntry key="org.eclipse.core.resources/perf/snapshot" value="1000"/>
<mapEntry key="org.eclipse.ui.intro/trace/logPerformance" value="false"/>
-<mapEntry key="org.eclipse.ui/trace/contexts.verbose" value="false"/>
<mapEntry key="org.eclipse.osgi/debug/loader" value="false"/>
+<mapEntry key="org.eclipse.ui/trace/contexts.verbose" value="false"/>
<mapEntry key="org.eclipse.osgi/resolver/grouping" value="false"/>
<mapEntry key="org.eclipse.jdt.ui/perf/explorer/makeActions" value="1000"/>
<mapEntry key="org.eclipse.net4j/debug.acceptor" value="true"/>
@@ -207,8 +207,8 @@
<mapEntry key="org.eclipse.ui.intro.universal/trace/logPerformance" value="false"/>
<mapEntry key="org.eclipse.help/debug/context" value="false"/>
<mapEntry key="org.eclipse.osgi/debug/manifest" value="false"/>
-<mapEntry key="org.eclipse.ui/trace/multipageeditor" value="false"/>
<mapEntry key="org.eclipse.emf.cdo/debug" value="true"/>
+<mapEntry key="org.eclipse.ui/trace/multipageeditor" value="false"/>
<mapEntry key="org.eclipse.emf.cdo.ui/debug" value="true"/>
<mapEntry key="org.eclipse.net4j.examples/debug" value="true"/>
<mapEntry key="org.eclipse.core.resources/build/needbuildstack" value="false"/>
@@ -220,12 +220,12 @@
<mapEntry key="org.eclipse.jdt.core/debug/builder" value="false"/>
<mapEntry key="org.eclipse.osgi/trace/classLoading" value="false"/>
<mapEntry key="org.eclipse.net4j.jms.server.jdbc/debug" value="true"/>
-<mapEntry key="org.eclipse.core.jobs/jobs/errorondeadlock" value="false"/>
<mapEntry key="org.eclipse.core.resources/save" value="false"/>
+<mapEntry key="org.eclipse.core.jobs/jobs/errorondeadlock" value="false"/>
<mapEntry key="org.eclipse.core.resources/contenttype" value="false"/>
<mapEntry key="org.eclipse.jface.text/debug/FastPartitioner/PositionCache" value="false"/>
-<mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/>
<mapEntry key="org.eclipse.emf.cdo.server/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.core/debug/compiler" value="false"/>
<mapEntry key="org.eclipse.osgi/debug/events" value="false"/>
<mapEntry key="org.eclipse.ui/trace/commands" value="false"/>
<mapEntry key="org.eclipse.equinox.preferences/get" value="false"/>
@@ -246,11 +246,11 @@
<mapEntry key="org.eclipse.pde.core/cache" value="false"/>
<mapEntry key="org.eclipse.emf.cdo/debug.transaction" value="true"/>
<mapEntry key="org.eclipse.emf.cdo.server.db/debug" value="true"/>
-<mapEntry key="org.eclipse.debug.core/debug/events" value="false"/>
<mapEntry key="org.eclipse.net4j/debug.selector" value="true"/>
+<mapEntry key="org.eclipse.debug.core/debug/events" value="false"/>
<mapEntry key="org.eclipse.jdt.ui/debug" value="true"/>
-<mapEntry key="org.eclipse.net4j.db/debug.sql" value="true"/>
<mapEntry key="org.eclipse.osgi/monitor/classes" value="false"/>
+<mapEntry key="org.eclipse.net4j.db/debug.sql" value="true"/>
<mapEntry key="org.eclipse.ui/perf/part.input" value="200"/>
<mapEntry key="org.eclipse.ui.intro.universal/debug" value="true"/>
<mapEntry key="org.eclipse.jdt.ui/debug/TypeConstraints" value="false"/>
@@ -266,16 +266,16 @@
<mapEntry key="org.eclipse.net4j.jms.admin/debug" value="true"/>
<mapEntry key="org.eclipse.emf.cdo/debug.model" value="true"/>
<mapEntry key="org.eclipse.jdt.core/debug/cpresolution" value="false"/>
-<mapEntry key="org.eclipse.help/debug/search" value="false"/>
<mapEntry key="org.eclipse.help.ui/debug/embeddedBrowser" value="false"/>
+<mapEntry key="org.eclipse.help/debug/search" value="false"/>
<mapEntry key="org.eclipse.team.cvs.ssh/ssh_protocol" value="false"/>
-<mapEntry key="org.eclipse.core.resources/build/stacktrace" value="false"/>
<mapEntry key="org.eclipse.ui/perf/part.create" value="800"/>
+<mapEntry key="org.eclipse.core.resources/build/stacktrace" value="false"/>
<mapEntry key="org.eclipse.ui.intro/trace/logInfo" value="true"/>
<mapEntry key="org.eclipse.team.core/streams" value="false"/>
<mapEntry key="org.eclipse.ui.ide/debug/undomonitor" value="false"/>
-<mapEntry key="org.eclipse.jdt.ui/perf/explorer/RefactorActionGroup" value="150"/>
<mapEntry key="org.eclipse.net4j.ui/debug" value="true"/>
+<mapEntry key="org.eclipse.jdt.ui/perf/explorer/RefactorActionGroup" value="150"/>
<mapEntry key="org.eclipse.ui/experimental/menus" value="false"/>
<mapEntry key="org.eclipse.core.jobs/jobs/shutdown" value="false"/>
<mapEntry key="org.eclipse.osgi/debug/packageadmin" value="false"/>
@@ -293,16 +293,16 @@
<mapEntry key="org.eclipse.net4j.chat/debug" value="true"/>
<mapEntry key="org.eclipse.ui.workbench/debug" value="false"/>
<mapEntry key="org.eclipse.jdt.ui/perf/content_assist/extensions" value="1000"/>
-<mapEntry key="org.eclipse.osgi/debug/filter" value="false"/>
<mapEntry key="org.eclipse.emf.cdo.protocol/debug.model" value="true"/>
+<mapEntry key="org.eclipse.osgi/debug/filter" value="false"/>
<mapEntry key="org.eclipse.debug.core/debug" value="false"/>
<mapEntry key="org.eclipse.core.resources/debug" value="false"/>
<mapEntry key="org.eclipse.jdt.core/debug/zipaccess" value="false"/>
-<mapEntry key="org.eclipse.ui.browser/debug" value="false"/>
<mapEntry key="org.eclipse.emf.cdo.server/debug.protocol" value="true"/>
+<mapEntry key="org.eclipse.ui.browser/debug" value="false"/>
<mapEntry key="org.eclipse.osgi/profile/impl" value="org.eclipse.osgi.internal.profile.DefaultProfileLogger"/>
-<mapEntry key="org.eclipse.net4j.jms.server/debug.protocol" value="true"/>
<mapEntry key="org.eclipse.update.core/debug/web" value="false"/>
+<mapEntry key="org.eclipse.net4j.jms.server/debug.protocol" value="true"/>
<mapEntry key="org.eclipse.team.cvs.core/debug" value="false"/>
<mapEntry key="org.eclipse.help/debug" value="true"/>
<mapEntry key="org.eclipse.core.runtime/perf" value="false"/>
@@ -313,10 +313,10 @@
<mapEntry key="org.eclipse.ui/perf/part.listeners" value="200"/>
<mapEntry key="org.eclipse.debug.ui/debug/viewers/viewer" value="false"/>
<mapEntry key="org.eclipse.ui/trace/keyBindings.verbose" value="false"/>
-<mapEntry key="org.eclipse.osgi/defaultprofile/buffersize" value="256"/>
<mapEntry key="org.eclipse.core.resources/restore/syncinfo" value="false"/>
-<mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/>
+<mapEntry key="org.eclipse.osgi/defaultprofile/buffersize" value="256"/>
<mapEntry key="org.eclipse.ui/perf/page.listeners" value="200"/>
+<mapEntry key="org.eclipse.team.cvs.core/syncchangeevents" value="false"/>
<mapEntry key="org.eclipse.emf.cdo.protocol/debug" value="true"/>
<mapEntry key="org.eclipse.emf.cdo/debug.resource" value="true"/>
<mapEntry key="org.eclipse.ui/trace/handlers.verbose" value="false"/>
@@ -334,8 +334,8 @@
<mapEntry key="org.eclipse.ui/listeners/IWorkbenchWindow.IPartListener" value="false"/>
<mapEntry key="org.eclipse.jdt.core/debug/resolution" value="false"/>
<mapEntry key="org.eclipse.update.configurator/debug" value="false"/>
-<mapEntry key="org.eclipse.help.ui/debug" value="true"/>
<mapEntry key="org.eclipse.debug.ui/debug/viewers/deltas" value="false"/>
+<mapEntry key="org.eclipse.help.ui/debug" value="true"/>
<mapEntry key="org.eclipse.osgi/eclipseadaptor/debug/location" value="false"/>
<mapEntry key="org.eclipse.ui.intro.universal/trace/logInfo" value="true"/>
</mapAttribute>
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java
index 948367a..5fc3ca5 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java
@@ -2,8 +2,9 @@ package org.eclipse.emf.cdo.internal.ui.actions;
import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.CDOView;
+import org.eclipse.emf.cdo.internal.ui.dialogs.RollbackTransactionDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.ui.IWorkbenchPage;
/**
@@ -15,6 +16,8 @@ public final class RollbackTransactionAction extends ViewAction
private static final String TOOL_TIP = "Rollback this transaction";
+ private boolean remote;
+
public RollbackTransactionAction(IWorkbenchPage page, CDOView view)
{
super(page, TITLE + INTERACTIVE, TOOL_TIP, null, view);
@@ -25,70 +28,25 @@ public final class RollbackTransactionAction extends ViewAction
protected void preRun() throws Exception
{
CDOTransaction transaction = (CDOTransaction)getView();
- int newResources = transaction.getNewResources().size();
- int newObjects = transaction.getNewObjects().size();
- int dirtyObjects = transaction.getDirtyObjects().size();
- int count = (newResources > 0 ? 1 : 0) + (newObjects > 0 ? 1 : 0) + (dirtyObjects > 0 ? 1 : 0);
-
- StringBuilder builder = new StringBuilder();
- builder.append("This transaction contains ");
- if (newResources > 0)
- {
- builder.append(newResources);
- builder.append(" new resource");
- if (newResources > 1)
- {
- builder.append("s");
- }
- }
-
- if (newObjects > 0)
- {
- if (newResources > 0)
- {
- if (count > 2)
- {
- builder.append(", ");
- }
- else
- {
- builder.append(" and ");
- }
- }
-
- builder.append(newObjects);
- builder.append(" new object");
- if (newObjects > 1)
- {
- builder.append("s");
- }
- }
-
- if (dirtyObjects > 0)
- {
- if (count > 1)
- {
- builder.append(" and ");
- }
-
- builder.append(dirtyObjects);
- builder.append(" dirty object");
- if (dirtyObjects > 1)
- {
- builder.append("s");
- }
- }
-
- builder.append(".\nAre you sure to rollback this transaction?");
- if (!MessageDialog.openQuestion(getShell(), TITLE, builder.toString()))
+ Dialog dialog = new RollbackTransactionDialog(getPage(), TITLE, "Choose how to rollback this transaction.",
+ transaction);
+ switch (dialog.open())
{
+ case RollbackTransactionDialog.REMOTE:
+ remote = true;
+ break;
+ case RollbackTransactionDialog.LOCAL:
+ remote = false;
+ break;
+ default:
cancel();
+ break;
}
}
@Override
protected void doRun() throws Exception
{
- getTransaction().rollback();
+ getTransaction().rollback(remote);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/RollbackTransactionDialog.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/RollbackTransactionDialog.java
new file mode 100644
index 0000000..b626b0a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/RollbackTransactionDialog.java
@@ -0,0 +1,178 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * 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.dialogs;
+
+import org.eclipse.emf.cdo.CDOTransaction;
+
+import org.eclipse.net4j.util.ui.UIUtil;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * @author Eike Stepper
+ */
+public class RollbackTransactionDialog extends TitleAreaDialog
+{
+ // public static final String TITLE = "Rollback Transaction";
+
+ public static final int REMOTE = CANCEL + 1;
+
+ public static final int LOCAL = CANCEL + 2;
+
+ private static final int REMOTE_ID = IDialogConstants.CLIENT_ID + REMOTE;
+
+ private static final int LOCAL_ID = IDialogConstants.CLIENT_ID + LOCAL;
+
+ private IWorkbenchPage page;
+
+ private String title;
+
+ private String description;
+
+ private CDOTransaction transaction;
+
+ public RollbackTransactionDialog(IWorkbenchPage page, String title, String description, CDOTransaction transaction)
+ {
+ super(new Shell(page.getWorkbenchWindow().getShell()));
+ this.page = page;
+ this.title = title;
+ this.description = description;
+ this.transaction = transaction;
+ setShellStyle(getShellStyle() | SWT.APPLICATION_MODAL | SWT.MAX | SWT.TITLE | SWT.RESIZE);
+ }
+
+ public IWorkbenchPage getPage()
+ {
+ return page;
+ }
+
+ @Override
+ protected void configureShell(Shell newShell)
+ {
+ super.configureShell(newShell);
+ newShell.setText(title);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent)
+ {
+ Composite composite = new Composite((Composite)super.createDialogArea(parent), SWT.NONE);
+ composite.setLayoutData(UIUtil.createGridData());
+ composite.setLayout(new GridLayout(1, false));
+
+ setTitle(description);
+ setTitleImage(getShell().getDisplay().getSystemImage(SWT.ICON_QUESTION));
+
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(formatMessage());
+ label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
+
+ return composite;
+ }
+
+ @Override
+ protected void createButtonsForButtonBar(Composite parent)
+ {
+ createButton(parent, REMOTE_ID, "Remote Rollback", true);
+ createButton(parent, LOCAL_ID, "Local Rollback", false);
+ createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+ }
+
+ @Override
+ protected void buttonPressed(int buttonId)
+ {
+ if (buttonId == REMOTE_ID)
+ {
+ setReturnCode(REMOTE);
+ close();
+ }
+ else if (buttonId == LOCAL_ID)
+ {
+ setReturnCode(LOCAL);
+ close();
+ }
+ else
+ {
+ super.buttonPressed(buttonId);
+ }
+ }
+
+ protected String formatMessage()
+ {
+ int newResources = transaction.getNewResources().size();
+ int newObjects = transaction.getNewObjects().size();
+ int dirtyObjects = transaction.getDirtyObjects().size();
+ int count = (newResources > 0 ? 1 : 0) + (newObjects > 0 ? 1 : 0) + (dirtyObjects > 0 ? 1 : 0);
+
+ StringBuilder builder = new StringBuilder();
+ builder.append("This transaction contains ");
+ if (newResources > 0)
+ {
+ builder.append(newResources);
+ builder.append(" new resource");
+ if (newResources > 1)
+ {
+ builder.append("s");
+ }
+ }
+
+ if (newObjects > 0)
+ {
+ if (newResources > 0)
+ {
+ if (count > 2)
+ {
+ builder.append(", ");
+ }
+ else
+ {
+ builder.append(" and ");
+ }
+ }
+
+ builder.append(newObjects);
+ builder.append(" new object");
+ if (newObjects > 1)
+ {
+ builder.append("s");
+ }
+ }
+
+ if (dirtyObjects > 0)
+ {
+ if (count > 1)
+ {
+ builder.append(" and ");
+ }
+
+ builder.append(dirtyObjects);
+ builder.append(" dirty object");
+ if (dirtyObjects > 1)
+ {
+ builder.append("s");
+ }
+ }
+
+ builder.append(".\nBe careful, rolling back to local state can result\n"
+ + "in visible state that is different from the remote state!");
+ builder.append("\n\nAre you sure to rollback this transaction?");
+ return builder.toString();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index 0129734..30c8ecc 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -12,6 +12,7 @@ import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.ui.SharedIcons;
import org.eclipse.emf.cdo.internal.ui.bundle.OM;
+import org.eclipse.emf.cdo.internal.ui.dialogs.RollbackTransactionDialog;
import org.eclipse.emf.cdo.internal.ui.views.CDOEventHandler;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
@@ -82,6 +83,7 @@ import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.viewers.ISelection;
@@ -1586,13 +1588,23 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
}
catch (final TransactionException exception)
{
- OM.LOG.error(exception);
final Shell shell = getSite().getShell();
shell.getDisplay().syncExec(new Runnable()
{
public void run()
{
- MessageDialog.openError(shell, "Transaction Error", exception.getMessage());
+ CDOTransaction transaction = (CDOTransaction)view;
+ Dialog dialog = new RollbackTransactionDialog(getEditorSite().getPage(), "Transaction Error",
+ exception.getMessage(), transaction);
+ switch (dialog.open())
+ {
+ case RollbackTransactionDialog.REMOTE:
+ transaction.rollback(true);
+ break;
+ case RollbackTransactionDialog.LOCAL:
+ transaction.rollback(false);
+ break;
+ }
}
});
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java
index 567b0dc..f38fbe4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java
@@ -33,4 +33,6 @@ public interface CDOObject extends EObject
public CDOResource cdoResource();
public CDORevision cdoRevision();
+
+ public boolean cdoRefresh(boolean force);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
index d869e63..ee4a56b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
@@ -38,15 +38,9 @@ public interface CDOTransaction extends CDOView
public CDOObject newInstance(CDOClass cdoClass);
- /**
- * @see CDOTransaction#commit()
- */
public void commit() throws TransactionException;
- /**
- * @see CDOTransaction#rollback()
- */
- public void rollback();
+ public void rollback(boolean remote);
public void addHandler(CDOTransactionHandler handler);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
index 0de8c82..703cc18 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
@@ -22,6 +22,7 @@ public class CDOAdapterImpl extends CDOLegacyImpl
{
}
+ @Override
public boolean isAdapterForType(Object type)
{
return type == CDOAdapterImpl.class;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
index fcf62e6..0a79ec6 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
@@ -101,6 +101,16 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
return view;
}
+ public boolean cdoRefresh(boolean force)
+ {
+ return CDOStateMachine.INSTANCE.refresh(this, force);
+ }
+
+ public boolean isAdapterForType(Object type)
+ {
+ return false;
+ }
+
public CDOState cdoInternalSetState(CDOState state)
{
if (this.state != state)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java
index 2efa067..4aa4a5d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java
@@ -50,6 +50,11 @@ public class CDOMetaImpl extends CDOWrapperImpl
throw new UnsupportedOperationException();
}
+ public boolean cdoRefresh(boolean force)
+ {
+ throw new UnsupportedOperationException();
+ }
+
public boolean cdoTransient()
{
return false;
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 c3ea214..c5f47a9 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
@@ -20,9 +20,6 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
-import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
-import org.eclipse.net4j.util.ImplementationError;
-
import org.eclipse.emf.common.util.BasicEMap;
import org.eclipse.emf.common.util.ECollections;
import org.eclipse.emf.common.util.EList;
@@ -43,6 +40,9 @@ import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.ImplementationError;
+
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -104,6 +104,11 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
return resource;
}
+ public boolean cdoRefresh(boolean force)
+ {
+ return CDOStateMachine.INSTANCE.refresh(this, force);
+ }
+
public void cdoInternalSetID(CDOID id)
{
if (id == null)
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 74889bd..f5a5079 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
@@ -48,63 +48,70 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
init(CDOState.TRANSIENT, CDOEvent.DETACH, FAIL);
init(CDOState.TRANSIENT, CDOEvent.READ, IGNORE);
init(CDOState.TRANSIENT, CDOEvent.WRITE, IGNORE);
+ init(CDOState.TRANSIENT, CDOEvent.INVALIDATE, FAIL);
+ init(CDOState.TRANSIENT, CDOEvent.REFRESH, IGNORE);
init(CDOState.TRANSIENT, CDOEvent.COMMIT, FAIL);
init(CDOState.TRANSIENT, CDOEvent.ROLLBACK, FAIL);
- init(CDOState.TRANSIENT, CDOEvent.INVALIDATE, FAIL);
init(CDOState.TRANSIENT, CDOEvent.FINALIZE_ATTACH, FAIL);
init(CDOState.PREPARED_ATTACH, CDOEvent.ATTACH, FAIL);
init(CDOState.PREPARED_ATTACH, CDOEvent.DETACH, FAIL);
init(CDOState.PREPARED_ATTACH, CDOEvent.READ, IGNORE);
init(CDOState.PREPARED_ATTACH, CDOEvent.WRITE, FAIL);
+ init(CDOState.PREPARED_ATTACH, CDOEvent.INVALIDATE, FAIL);
+ init(CDOState.PREPARED_ATTACH, CDOEvent.REFRESH, FAIL);
init(CDOState.PREPARED_ATTACH, CDOEvent.COMMIT, FAIL);
init(CDOState.PREPARED_ATTACH, CDOEvent.ROLLBACK, FAIL);
- init(CDOState.PREPARED_ATTACH, CDOEvent.INVALIDATE, FAIL);
init(CDOState.PREPARED_ATTACH, CDOEvent.FINALIZE_ATTACH, new FinalizeAttachTransition());
init(CDOState.NEW, CDOEvent.ATTACH, FAIL);
init(CDOState.NEW, CDOEvent.DETACH, FAIL);
init(CDOState.NEW, CDOEvent.READ, IGNORE);
init(CDOState.NEW, CDOEvent.WRITE, IGNORE);
+ init(CDOState.NEW, CDOEvent.INVALIDATE, FAIL);
+ init(CDOState.NEW, CDOEvent.REFRESH, IGNORE);
init(CDOState.NEW, CDOEvent.COMMIT, new CommitTransition());
init(CDOState.NEW, CDOEvent.ROLLBACK, FAIL);
- init(CDOState.NEW, CDOEvent.INVALIDATE, FAIL);
init(CDOState.NEW, CDOEvent.FINALIZE_ATTACH, FAIL);
init(CDOState.CLEAN, CDOEvent.ATTACH, FAIL);
init(CDOState.CLEAN, CDOEvent.DETACH, FAIL);
init(CDOState.CLEAN, CDOEvent.READ, IGNORE);
init(CDOState.CLEAN, CDOEvent.WRITE, new WriteTransition());
+ init(CDOState.CLEAN, CDOEvent.INVALIDATE, new InvalidateTransition());
+ init(CDOState.CLEAN, CDOEvent.REFRESH, new RefreshTransition());
init(CDOState.CLEAN, CDOEvent.COMMIT, FAIL);
init(CDOState.CLEAN, CDOEvent.ROLLBACK, FAIL);
- init(CDOState.CLEAN, CDOEvent.INVALIDATE, new InvalidateTransition());
init(CDOState.CLEAN, CDOEvent.FINALIZE_ATTACH, FAIL);
init(CDOState.DIRTY, CDOEvent.ATTACH, FAIL);
init(CDOState.DIRTY, CDOEvent.DETACH, FAIL);
init(CDOState.DIRTY, CDOEvent.READ, IGNORE);
init(CDOState.DIRTY, CDOEvent.WRITE, IGNORE);
+ init(CDOState.DIRTY, CDOEvent.INVALIDATE, new ConflictTransition());
+ init(CDOState.DIRTY, CDOEvent.REFRESH, new RefreshTransition());
init(CDOState.DIRTY, CDOEvent.COMMIT, new CommitTransition());
init(CDOState.DIRTY, CDOEvent.ROLLBACK, new RollbackTransition());
- init(CDOState.DIRTY, CDOEvent.INVALIDATE, new ConflictTransition());
init(CDOState.DIRTY, CDOEvent.FINALIZE_ATTACH, FAIL);
init(CDOState.PROXY, CDOEvent.ATTACH, new LoadResourceTransition());
init(CDOState.PROXY, CDOEvent.DETACH, new DetachTransition());
init(CDOState.PROXY, CDOEvent.READ, new LoadTransition(false));
init(CDOState.PROXY, CDOEvent.WRITE, new LoadTransition(true));
+ init(CDOState.PROXY, CDOEvent.INVALIDATE, IGNORE);
+ init(CDOState.PROXY, CDOEvent.REFRESH, new RefreshTransition());
init(CDOState.PROXY, CDOEvent.COMMIT, FAIL);
init(CDOState.PROXY, CDOEvent.ROLLBACK, FAIL);
- init(CDOState.PROXY, CDOEvent.INVALIDATE, IGNORE);
init(CDOState.PROXY, CDOEvent.FINALIZE_ATTACH, IGNORE);
init(CDOState.CONFLICT, CDOEvent.ATTACH, IGNORE);
init(CDOState.CONFLICT, CDOEvent.DETACH, IGNORE);
init(CDOState.CONFLICT, CDOEvent.READ, IGNORE);
init(CDOState.CONFLICT, CDOEvent.WRITE, IGNORE);
+ init(CDOState.CONFLICT, CDOEvent.INVALIDATE, IGNORE);
+ init(CDOState.CONFLICT, CDOEvent.REFRESH, new RefreshTransition());
init(CDOState.CONFLICT, CDOEvent.COMMIT, IGNORE);
init(CDOState.CONFLICT, CDOEvent.ROLLBACK, new RollbackTransition());
- init(CDOState.CONFLICT, CDOEvent.INVALIDATE, IGNORE);
init(CDOState.CONFLICT, CDOEvent.FINALIZE_ATTACH, IGNORE);
}
@@ -141,6 +148,14 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
process(object, CDOEvent.WRITE, null);
}
+ public boolean refresh(InternalCDOObject object, boolean force)
+ {
+ if (TRACER.isEnabled()) trace(object, CDOEvent.REFRESH);
+ boolean[] forceAndResult = { force };
+ process(object, CDOEvent.REFRESH, forceAndResult);
+ return forceAndResult[0];
+ }
+
public void invalidate(InternalCDOObject object, long timeStamp)
{
if (TRACER.isEnabled()) trace(object, CDOEvent.INVALIDATE);
@@ -153,10 +168,10 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
process(object, CDOEvent.COMMIT, result);
}
- public void rollback(InternalCDOObject object)
+ public void rollback(InternalCDOObject object, boolean remote)
{
if (TRACER.isEnabled()) trace(object, CDOEvent.ROLLBACK);
- process(object, CDOEvent.ROLLBACK, null);
+ process(object, CDOEvent.ROLLBACK, remote);
}
@Override
@@ -308,9 +323,9 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
/**
* @author Eike Stepper
*/
- private final class RollbackTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, Object>
+ private final class RollbackTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, Boolean>
{
- public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Object NULL)
+ public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Boolean remote)
{
CDOViewImpl view = (CDOViewImpl)object.cdoView();
@@ -323,7 +338,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
CDORevisionImpl previousRevision = revisionManager.getRevisionByVersion(id, 0, version - 1);
object.cdoInternalSetRevision(previousRevision);
- changeState(object, CDOState.PROXY);
+ changeState(object, remote ? CDOState.PROXY : CDOState.CLEAN);
}
}
@@ -350,22 +365,52 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
/**
* @author Eike Stepper
*/
- private final class InvalidateTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, Long>
+ private final class RefreshTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, boolean[]>
+ {
+ public void execute(InternalCDOObject object, CDOState state, CDOEvent event, boolean[] forceAndResult)
+ {
+ if (forceAndResult[0])
+ {
+ }
+
+ changeState(object, CDOState.CLEAN);
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private class InvalidateTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, Long>
{
public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Long timeStamp)
{
- ((CDORevisionImpl)object.cdoRevision()).setRevised(timeStamp - 1);
+ reviseObject(object, timeStamp);
changeState(object, CDOState.PROXY);
}
+
+ protected void reviseObject(InternalCDOObject object, Long timeStamp)
+ {
+ CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
+ revision.setRevised(timeStamp - 1);
+
+ if (revision.isTransactional())
+ {
+ CDOViewImpl view = (CDOViewImpl)object.cdoView();
+ revision = view.getRevision(object.cdoID());
+ revision.setRevised(timeStamp - 1);
+ }
+ }
}
/**
* @author Eike Stepper
*/
- private final class ConflictTransition implements ITransition<CDOState, CDOEvent, InternalCDOObject, Long>
+ private final class ConflictTransition extends InvalidateTransition
{
+ @Override
public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Long timeStamp)
{
+ reviseObject(object, timeStamp);
CDOViewImpl view = (CDOViewImpl)object.cdoView();
CDOTransactionImpl transaction = view.toTransaction();
transaction.setConflict(object);
@@ -452,5 +497,5 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
*/
enum CDOEvent
{
- ATTACH, DETACH, READ, WRITE, COMMIT, ROLLBACK, INVALIDATE, FINALIZE_ATTACH
+ ATTACH, DETACH, READ, WRITE, INVALIDATE, REFRESH, COMMIT, ROLLBACK, FINALIZE_ATTACH
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index ea857c2..22759d4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -227,7 +227,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
}
}
- public void rollback()
+ public void rollback(boolean remote)
{
checkWritable();
@@ -254,7 +254,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
{
for (CDOObject dirtyObject : dirtyObjects.values())
{
- CDOStateMachine.INSTANCE.rollback((InternalCDOObject)dirtyObject);
+ CDOStateMachine.INSTANCE.rollback((InternalCDOObject)dirtyObject, remote);
}
}