|
Re: [CDO] Transaction Exception [message #513610 is a reply to message #513552] |
Wed, 10 February 2010 11:56 |
|
Am 10.02.2010 15:47, schrieb Sabri Skhiri:
> All,
>
> I am playing with the material given by Eike at Eclipse summit during
> the Advanced Programming Techniques with EMF and CDO.
> I have a problem when creating a simple Root Eobject within a
> transaction:
> CDOSession session = openSession();
> session.getPackageRegistry().putEPackage(InventoryPackage.eI NSTANCE);
putEPackage() shouldn't be necessary.
> // open the transaction
> CDOTransaction transaction = session.openTransaction();
>
> // create the resource
> CDOResource resource =
> transaction.getResource("/edine/resto2.inventory");
Shouldn't that be createResource()?
> // Work with resource
> Restaurant restaurant = InventoryFactory.eINSTANCE.createRestaurant();
> resource.getContents().add(restaurant);
>
> // Commit the transaction
> transaction.commit();
>
> session.close();
>
> But I have got a TransactionException due to the "id instanceof
> CDOIDTemp".
> Have you got any idea ?
>
>
>
> The exception is:
I admit that te exception message is not very convenient :P
Which exact version of CDO are you using?
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
> Exception in thread "main"
> org.eclipse.net4j.util.transaction.TransactionException: Rollback in
> DBStore: java.lang.IllegalArgumentException: id instanceof CDOIDTemp
> at org.eclipse.emf.cdo.common.id.CDOIDUtil.getLong(CDOIDUtil.ja va:87)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.getMe
> taID(MetaDataManager.java:72)
> at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappi
> ngStrategy.getTableName(AbstractMappingStrategy.java:256)
> at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ab
> stractHorizontalClassMapping.initTable(AbstractHorizontalCla
> ssMapping.java:82)
> at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ab
> stractHorizontalClassMapping.
> <init>(AbstractHorizontalClassMapping.java:76)
> at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ho
> rizontalAuditClassMapping. <init>(HorizontalAuditClassMapping.java:64)
> at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ho
> rizontalAuditMappingStrategy.doCreateClassMapping(Horizontal
> AuditMappingStrategy.java:29)
> at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappi
> ngStrategy.createClassMapping(AbstractMappingStrategy.java:3 84)
> at org.eclipse.emf.cdo.server.internal.db.mapping.AbstractMappi
> ngStrategy.getClassMapping(AbstractMappingStrategy.java:411)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write
> Revision(DBStoreAccessor.java:359)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write
> Revisions(DBStoreAccessor.java:342)
> at org.eclipse.emf.cdo.spi.server.StoreAccessor.write(StoreAcce
> ssor.java:145)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.acces
> s$4(DBStoreAccessor.java:1)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run
> Loop(DBStoreAccessor.java:80)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor$1.run
> Loop(DBStoreAccessor.java:1)
> at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr
> ogressDistributor.java:96)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write
> (DBStoreAccessor.java:299)
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext
> Impl.write(TransactionCommitContextImpl.java:273)
> at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTra
> nsactionIndication$1.runLoop(CommitTransactionIndication.jav a:72)
> at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTra
> nsactionIndication$1.runLoop(CommitTransactionIndication.jav a:1)
> at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(Pr
> ogressDistributor.java:96)
> at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTra
> nsactionIndication.indicatingCommit(CommitTransactionIndicat
> ion.java:280)
> at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTra
> nsactionIndication.indicating(CommitTransactionIndication.ja va:173)
> at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTra
> nsactionIndication.indicating(CommitTransactionIndication.ja va:139)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating
> (IndicationWithMonitoring.java:84)
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedIn
> put(IndicationWithResponse.java:90)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:312)
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi
> cationWithResponse.java:63)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(In
> dicationWithMonitoring.java:63)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:239)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa
> dPoolExecutor.java:650)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
> lExecutor.java:675)
> at java.lang.Thread.run(Thread.java:595)
>
> at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio
> nStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:6 3)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.
> commit(CDOTransactionImpl.java:621)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.
> commit(CDOTransactionImpl.java:635)
> at org.gastro.exercises.Exercice11b.main(Exercice11b.java:90)
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
|
|
|
Re: [CDO] Transaction Exception [message #514036 is a reply to message #513915] |
Fri, 12 February 2010 09:23 |
|
Hi Sabri,
I've played with the zips you sent. There's one obvious bug in your
model plugin.xml. The referenced package class does not exist because
you added a package base prefix. Fixing that should enable you to import
the XML file. But you're right, there seems to be a regression in the
DBStore that causes temporary meta IDs not being remapped after
successful commits. Please file a bugzilla.
If you want to go ahead, please try out the MEMStore instead of the DBStore:
IStore store = MEMStoreUtil.createMEMStore();
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 11.02.2010 17:23, schrieb Sabri Skhiri:
> Eike,
> I have tried by creating a transaction with the CDO UI Client. The
> creation of an empty resource works, but if I try to create something
> within this resource it fails when I commit with this same strange
> exception. The same if I try from a client Transaction API.
>
> Therefore, I downloaded all the CDO 3.0 sources from repository and I
> re-test the same use case, it fails with the same exception.
> Have you got any idea ?
> Thank you,
>
> Sabri.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.02139 seconds