summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-12-28 06:45:30 (EST)
committerEike Stepper2007-12-28 06:45:30 (EST)
commitaf753bff327b0655be4e13b8fca50246d439af3a (patch)
tree05a66ca0f43a945e94f8b8cfe69ccbc5da23ec65
parent7558fa63ffcd48e03c9855298babe27d150da5f0 (diff)
downloadcdo-af753bff327b0655be4e13b8fca50246d439af3a.zip
cdo-af753bff327b0655be4e13b8fca50246d439af3a.tar.gz
cdo-af753bff327b0655be4e13b8fca50246d439af3a.tar.bz2
[213782] Transaction DeadLock
https://bugs.eclipse.org/bugs/show_bug.cgi?id=213782
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ViewsChangedIndication.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedNotification.java)21
4 files changed, 32 insertions, 23 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ViewsChangedIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ViewsChangedIndication.java
index d3fcbc1..fcbf696 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ViewsChangedIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ViewsChangedIndication.java
@@ -10,18 +10,17 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
+import java.io.IOException;
+
import org.eclipse.emf.cdo.internal.server.Session;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
-
-import org.eclipse.net4j.signal.Indication;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-
-import java.io.IOException;
+import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
/**
* @author Eike Stepper
*/
-public class ViewsChangedIndication extends Indication
+public class ViewsChangedIndication extends CDOServerIndication
{
public ViewsChangedIndication()
{
@@ -36,11 +35,16 @@ public class ViewsChangedIndication extends Indication
@Override
protected void indicating(ExtendedDataInputStream in) throws IOException
{
- int viewID = in.readInt();
- byte kind = in.readByte();
+ int viewID = in.readInt();
+ byte kind = in.readByte();
+ CDOServerProtocol protocol = (CDOServerProtocol)getProtocol();
+ Session session = protocol.getSession();
+ session.notifyViewsChanged(session, viewID, kind);
+ }
- CDOServerProtocol protocol = (CDOServerProtocol)getProtocol();
- Session session = protocol.getSession();
- session.notifyViewsChanged(session, viewID, kind);
+ @Override
+ protected void responding(ExtendedDataOutputStream out) throws IOException
+ {
+ out.writeBoolean(true);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java
index fa317be..a74af96 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RandomDeadLockTest.java
@@ -47,7 +47,7 @@ public class RandomDeadLockTest extends AbstractCDOTest
for (int i = 0; i < 100; i++)
{
- msg("Loop " + i);
+ msg("Session " + i);
CDOSession session = openModel1Session();
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.getResource("/test2");
@@ -70,7 +70,7 @@ public class RandomDeadLockTest extends AbstractCDOTest
for (int i =0; i < 1000; i++)
{
- msg("Loop " + i);
+ msg("Transaction " + i);
transaction = session.openTransaction(new ResourceSetImpl());
CDOResource resource = transaction.getResource("/test2");
Category category = Model1Factory.eINSTANCE.createCategory();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index cfb6dda..207d4be 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -37,7 +37,7 @@ import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.protocol.OpenSessionRequest;
import org.eclipse.emf.internal.cdo.protocol.OpenSessionResult;
import org.eclipse.emf.internal.cdo.protocol.QueryObjectTypesRequest;
-import org.eclipse.emf.internal.cdo.protocol.ViewsChangedNotification;
+import org.eclipse.emf.internal.cdo.protocol.ViewsChangedRequest;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
import org.eclipse.emf.internal.cdo.util.ProxyResolverURIResourceMap;
@@ -333,7 +333,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession
try
{
- new ViewsChangedNotification(channel, view.getViewID(), CDOProtocolConstants.VIEW_CLOSED).send();
+ new ViewsChangedRequest(channel, view.getViewID(), CDOProtocolConstants.VIEW_CLOSED).send();
}
catch (Exception ex)
{
@@ -653,7 +653,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession
{
int id = view.getViewID();
byte kind = getKind(view);
- new ViewsChangedNotification(channel, id, kind).send();
+ new ViewsChangedRequest(channel, id, kind).send();
}
catch (Exception ex)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedNotification.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedRequest.java
index 5656446..e18a3b4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedNotification.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedRequest.java
@@ -10,24 +10,23 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
-import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+import java.io.IOException;
+import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.net4j.IChannel;
-import org.eclipse.net4j.signal.Request;
+import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-import java.io.IOException;
-
/**
* @author Eike Stepper
*/
-public class ViewsChangedNotification extends Request
+public class ViewsChangedRequest extends CDOClientRequest<Boolean>
{
private int viewID;
private byte kind;
- public ViewsChangedNotification(IChannel channel, int viewID, byte kind)
+ public ViewsChangedRequest(IChannel channel, int viewID, byte kind)
{
super(channel);
this.viewID = viewID;
@@ -43,7 +42,13 @@ public class ViewsChangedNotification extends Request
@Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
- out.writeInt(viewID);
- out.writeByte(kind);
+ out.writeInt(viewID);
+ out.writeByte(kind);
+ }
+
+ @Override
+ protected Boolean confirming(ExtendedDataInputStream in) throws IOException
+ {
+ return in.readBoolean();
}
}