Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2020-06-30 06:46:30 +0000
committerEike Stepper2020-06-30 06:46:30 +0000
commit1710aab6dd82537bd9dfcd780ccf7f0669c7d6ca (patch)
tree9970ccc7f60f34e40409e5bba36df044db4b01eb
parent0bb8e08a28cbdc6dd69c825eba9a1f54408a9411 (diff)
downloadcdo-1710aab6dd82537bd9dfcd780ccf7f0669c7d6ca.tar.gz
cdo-1710aab6dd82537bd9dfcd780ccf7f0669c7d6ca.tar.xz
cdo-1710aab6dd82537bd9dfcd780ccf7f0669c7d6ca.zip
[564762] CDORepository is not properly disconnected when remote session closesHEADmaster
https://bugs.eclipse.org/bugs/show_bug.cgi?id=564762
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
index a2e6a2a504..d0a3740406 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
@@ -274,6 +274,7 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
protected void doConnect()
{
boolean connected = false;
+ CDOSession newSession = null;
synchronized (this)
{
@@ -290,7 +291,8 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
@Override
protected void onDeactivated(ILifecycle lifecycle)
{
- disconnect();
+ explicitlyConnected = false;
+ doDisconnect(true);
}
});
@@ -300,14 +302,10 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
CDOBranch mainBranch = branchManager.getMainBranch();
mainBranch.addListener(mainBranchListener);
+ newSession = session;
state = State.Connected;
}
- catch (RuntimeException ex)
- {
- state = State.Disconnected;
- throw ex;
- }
- catch (Error ex)
+ catch (RuntimeException | Error ex)
{
state = State.Disconnected;
throw ex;
@@ -322,7 +320,7 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
CDORepositoryManagerImpl manager = getManager();
if (manager != null)
{
- manager.fireRepositoryConnectionEvent(this, session, true);
+ manager.fireRepositoryConnectionEvent(this, newSession, true);
}
}
}
@@ -361,6 +359,7 @@ public abstract class CDORepositoryImpl extends AbstractElement implements CDORe
finally
{
session = null;
+ sessionRefCount = 0;
state = State.Disconnected;
}

Back to the top