Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] ClassCastException when removing one entry from the model
[CDO] ClassCastException when removing one entry from the model [message #989023] Tue, 04 December 2012 05:48 Go to previous message
Silvestre Martins is currently offline Silvestre Martins
Messages: 30
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 05:49]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic:[CDO] OCL Query to sql
Next Topic:[CDO] launch error with offline example
Goto Forum:
  


Current Time: Thu May 23 03:04:13 EDT 2013

Powered by FUDForum. Page generated in 0.04660 seconds