[CDO] ClassCastException when removing one entry from the model [message #989023] |
Tue, 04 December 2012 10:48 |
Silvestre Martins Messages: 84 Registered: July 2009 |
Member |
|
|
I have a simple test, where I get the resource and try to remove the last entry from the contents list:
CDOResource resource = tx.getOrCreateResource(RESOURCE_NAME);
EList<EObject> contents = resource.getContents();
int size = contents.size();
contents.remove(size-1);
tx.commit();
The list contains 200.000 entries.
If I run the test just after starting the CDO server, then I get this exception when committing:
java.lang.ClassCastException: org.eclipse.emf.cdo.internal.server.TransactionCommitContext$DeltaLockWrapper$ForID cannot be cast to org.eclipse.emf.cdo.spi.common.id.AbstractCDOID
at org.eclipse.emf.cdo.common.id.CDOIDUtil.write(CDOIDUtil.java:501)
at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDOID(CDODataOutputImpl.java:343)
at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDOLockState(CDODataOutputImpl.java:294)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.UnlockObjectsIndication.responding(UnlockObjectsIndication.java:83)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndication.responding(CDOServerIndication.java:134)
at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOutput(IndicationWithResponse.java:98)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:298)
at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:67)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerWriteIndication.execute(CDOServerWriteIndication.java:39)
java.lang.IllegalMonitorStateException
at org.eclipse.net4j.util.concurrent.RWOLockManager.unlock2(RWOLockManager.java:187)
at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.unlockObjects(TransactionCommitContext.java:1026)
at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.rollback(TransactionCommitContext.java:1155)
at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.handleException(TransactionCommitContext.java:583)
at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:532)
at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:46)
at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
at org.eclipse.emf.cdo.internal.server.Repository.commitUnsynced(Repository.java:917)
at org.eclipse.emf.cdo.internal.server.Repository.commit(Repository.java:910)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:295)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:97)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:86)
If I rerun the test without restarting the CDO server, then the test succeeds.
Am I doing something wrong?
Or is there other more efficient way to remove entries?
Might it be due to the huge amount of entries in the list? I was expecting that the number of entries in this case was not relevant, because it should remove directly from the index, without iterating over all the list, right?
However, is not in the remove that is takes too long to execute, but during the commit.
--
Silvestre
[Updated on: Tue, 04 December 2012 10:49] Report message to a moderator
|
|
|
Re: [CDO] ClassCastException when removing one entry from the model [message #989113 is a reply to message #989023] |
Tue, 04 December 2012 16:33 |
|
Am 04.12.2012 11:48, schrieb Silvestre Martins:
> I have a simple test, where I get the resource and try to remove the last entry from the contents list:
>
> CDOResource resource = tx.getOrCreateResource(RESOURCE_NAME);
> EList<EObject> contents = resource.getContents();
> int size = contents.size();
>
> contents.remove(size-1);
>
> tx.commit();
>
> The list contains 200.000 entries.
> If I run the test just after starting the CDO server, then I get this exception when committing:
>
> java.lang.ClassCastException: org.eclipse.emf.cdo.internal.server.TransactionCommitContext$DeltaLockWrapper$ForID
> cannot be cast to org.eclipse.emf.cdo.spi.common.id.AbstractCDOID
> at org.eclipse.emf.cdo.common.id.CDOIDUtil.write(CDOIDUtil.java:501)
I think that's a bug that noone has uncovered before. Should be easy to fix by letting DeltaLockWrapper extend
AbstractCDOID. Please submit a bugzilla.
> at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDOID(CDODataOutputImpl.java:343)
> at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDOLockState(CDODataOutputImpl.java:294)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.UnlockObjectsIndication.responding(UnlockObjectsIndication.java:83)
> at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndication.responding(CDOServerIndication.java:134)
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOutput(IndicationWithResponse.java:98)
> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:298)
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:67)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerWriteIndication.execute(CDOServerWriteIndication.java:39)
>
> java.lang.IllegalMonitorStateException
> at org.eclipse.net4j.util.concurrent.RWOLockManager.unlock2(RWOLockManager.java:187)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.unlockObjects(TransactionCommitContext.java:1026)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.rollback(TransactionCommitContext.java:1155)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.handleException(TransactionCommitContext.java:583)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:532)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:46)
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
> at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
> at org.eclipse.emf.cdo.internal.server.Repository.commitUnsynced(Repository.java:917)
> at org.eclipse.emf.cdo.internal.server.Repository.commit(Repository.java:910)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:295)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:97)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:86)
>
>
> If I rerun the test without restarting the CDO server, then the test succeeds.
>
> Am I doing something wrong?
> Or is there other more efficient way to remove entries?
>
> Might it be due to the huge amount of entries in the list? I was expecting that the number of entries in this case was
> not relevant, because it should remove directly from the index, without iterating over all the list, right?
I can currently not judge whether this is a follow-up problem of the one above. Let's address that one first.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03393 seconds