Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-01-10 11:16:31 +0000
committerEike Stepper2016-01-11 07:59:31 +0000
commite99a56c278527391719d5a44504d1d73791b7eff (patch)
tree95a3698680bb4da39c21928895557154fe7f58d2 /plugins/org.eclipse.emf.cdo.explorer.ui
parent9f0637117104cd867cccf5deb3e05bb3261eb7a1 (diff)
downloadcdo-e99a56c278527391719d5a44504d1d73791b7eff.tar.gz
cdo-e99a56c278527391719d5a44504d1d73791b7eff.tar.xz
cdo-e99a56c278527391719d5a44504d1d73791b7eff.zip
[485487] Network timeouts can lead to incorrect rollback and stuck session/transaction
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485487
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.explorer.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/ResourceGroup.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/wizards/NewWizard.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java10
4 files changed, 31 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java
index 3e926bb4e4..7d9078720d 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/CDOModelEditorOpener.java
@@ -25,6 +25,7 @@ import org.eclipse.emf.internal.cdo.transaction.CDOHandlingConflictResolver;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.spi.cdo.CDOMergingConflictResolver;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
@@ -48,6 +49,13 @@ public class CDOModelEditorOpener extends CDOEditorOpener.Default
protected IEditorPart doOpenEditor(final IWorkbenchPage page, URI uri)
{
CDOCheckout checkout = CDOExplorerUtil.getCheckout(uri);
+ if (checkout == null)
+ {
+ MessageDialog.openError(page.getWorkbenchWindow().getShell(), "Error",
+ "The checkout for " + uri + " could not be found.");
+ return null;
+ }
+
final CDOView view = checkout.openView();
if (view instanceof CDOTransaction)
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/ResourceGroup.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/ResourceGroup.java
index bde71d9f91..ee4aa2d47c 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/ResourceGroup.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/ResourceGroup.java
@@ -80,7 +80,9 @@ public class ResourceGroup extends CDOElement
public void setName(final String name)
{
final String type = getType();
- new Job("Rename " + type.toLowerCase())
+ final String title = "Rename " + type.toLowerCase();
+
+ new Job(title)
{
@Override
protected IStatus run(IProgressMonitor monitor)
@@ -118,7 +120,11 @@ public class ResourceGroup extends CDOElement
if (commitInfo != null)
{
- checkout.getView().waitForUpdate(commitInfo.getTimeStamp());
+ if (!checkout.getView().waitForUpdate(commitInfo.getTimeStamp(), 10000))
+ {
+ OM.LOG.error(title + ": Did not receive an update");
+ return Status.OK_STATUS;
+ }
CDOCheckoutManagerImpl checkoutManager = (CDOCheckoutManagerImpl)CDOExplorerUtil.getCheckoutManager();
checkoutManager.fireElementChangedEvent(ElementsChangedEvent.StructuralImpact.PARENT,
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/wizards/NewWizard.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/wizards/NewWizard.java
index b3691d5fe8..78dc864993 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/wizards/NewWizard.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/wizards/NewWizard.java
@@ -87,6 +87,7 @@ public abstract class NewWizard extends Wizard implements INewWizard
{
final Object parent = page.getParent();
final String name = page.getName();
+ final String error = "An error occured while creating the " + title.toLowerCase() + ".";
new Job(title)
{
@@ -139,8 +140,7 @@ public abstract class NewWizard extends Wizard implements INewWizard
{
public void run()
{
- ErrorDialog.openError(getShell(), "Error",
- "An error occured while creating the " + title.toLowerCase() + ".", status);
+ ErrorDialog.openError(getShell(), "Error", error, status);
}
});
@@ -154,7 +154,11 @@ public abstract class NewWizard extends Wizard implements INewWizard
if (commitInfo != null && contentProvider != null)
{
CDOView view = checkout.getView();
- view.waitForUpdate(commitInfo.getTimeStamp());
+ if (!view.waitForUpdate(commitInfo.getTimeStamp(), 10000))
+ {
+ OM.LOG.error(error + " Did not receive an update");
+ return Status.OK_STATUS;
+ }
CDOObject newObject = view.getObject(newID);
contentProvider.selectObjects(newObject);
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java
index dbba91d79a..90be3ab992 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java
@@ -194,7 +194,9 @@ public class ExplorerUIAdapterFactory implements IAdapterFactory
public void setName(final String name)
{
- new Job("Rename " + getType().toLowerCase())
+ final String title = "Rename " + getType().toLowerCase();
+
+ new Job(title)
{
@Override
protected IStatus run(IProgressMonitor monitor)
@@ -232,7 +234,11 @@ public class ExplorerUIAdapterFactory implements IAdapterFactory
if (commitInfo != null && checkout != null)
{
- checkout.getView().waitForUpdate(commitInfo.getTimeStamp());
+ if (!checkout.getView().waitForUpdate(commitInfo.getTimeStamp(), 10000))
+ {
+ OM.LOG.error(title + ": Did not receive an update");
+ return Status.OK_STATUS;
+ }
CDOCheckoutManagerImpl checkoutManager = (CDOCheckoutManagerImpl)CDOExplorerUtil.getCheckoutManager();
checkoutManager.fireElementChangedEvent(ElementsChangedEvent.StructuralImpact.PARENT, resourceNode);

Back to the top