Community
Participate
Working Groups
Build-ID:3.0.0.v200910010403 and main trunk on CVS as well Bug related to the topic http://www.eclipse.org/forums/index.php?t=msg&goto=514394&#msg_514394 I am playing with the material given by Eike at Eclipse summit during the Advanced Programming Techniques with EMF and CDO, but I have got the same problem with the last CVS version: I have a problem when creating a simple Root Eobject within a transaction: CDOSession session = openSession(); session.getPackageRegistry().putEPackage(InventoryPackage.eINSTANCE); // open the transaction CDOTransaction transaction = session.openTransaction(); // create the resource CDOResource resource = transaction.getResource("/edine/resto2.inventory"); // Work with resource Restaurant restaurant = InventoryFactory.eINSTANCE.createRestaurant(); resource.getContents().add(restaurant); // Commit the transaction transaction.commit(); session.close(); Same problem when committing from the CDO session UI. The exception is: 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)
Hi Sabri, thanks for your Bug report. So far I am not able to reproduce it, though. I have put your code into a test class: public class Bugzilla_302838_Test extends AbstractCDOTest { public void testRestaurant() { { CDOSession session = openSession(); // open the transaction CDOTransaction transaction = session.openTransaction(); // create the resource transaction.createResource("/edine/resto2.inventory"); transaction.commit(); session.close(); } CDOSession session = openSession(); session.getPackageRegistry().putEPackage(InventoryPackage.eINSTANCE); // open the transaction CDOTransaction transaction = session.openTransaction(); // create the resource CDOResource resource = transaction.getResource("/edine/resto2.inventory"); // Work with resource Restaurant restaurant = InventoryFactory.eINSTANCE.createRestaurant(); resource.getContents().add(restaurant); // Commit the transaction transaction.commit(); session.close(); } } I had to introduce the block above, because the resource obviously would not exist on an empty database. I tried the code with several databases and configurations, but could not provoke the exception you report. Can you please give some more information about you configuration? Which DB do you use? What is your server configuration? Also, can you tell me how your resource is created in the code you gave?
As a side-note: Eike, the Exception implies that the following call CDOID cdoid = getPackageRegistry().getMetaInstanceMapper().lookupMetaInstanceID((InternalEObject)modelElement); returns a CDOIDTemp for a modelElement instanceof EStructuralFeature. How can this happen?
Hi Stefan, Thanx for your reactivity. Actually even I create the resource before, and that this creation successes, if I try to commit something on this resource it fails. So, I do no think that getOrCreateResource() or createResource() are involved. Note: the package was registered as Dynamic in CDO, not as native. Does it change anything ? Configuration info: * DB: h2 * CDO 3.0.0.v200910010403 and Last from repository * Exception on Linux Ubuntu and Win XP Do you need something else ?
Stefan asked for someone to comment whether bug 303466 might have any relation to this. At first sight, I think not, because the code snippets I see here use the generated InventoryPackage. But then I'm a bit confused by Sabri's Feb 17 comment that "the package was registered as Dynamic in CDO, not as native"... I'm guessing we either do not agree on the meaning of the term "dynamic", which AFAIC is defined by EMFUtil.isDynamicPackage(Object); or perhaps the code which actually produced the stacktrace is different from what's given in the initial bug report? Please clarify..
(In reply to comment #4) > But then I'm a bit confused by Sabri's Feb 17 comment that "the > package was registered as Dynamic in CDO, not as native"... Just a minor correction: dynamic models are in fact native. At runtime they are using DynamicCDOObjects which derive from CDOObjectImpl.
(In reply to comment #5) > Just a minor correction: dynamic models are in fact native. At runtime they are > using DynamicCDOObjects which derive from CDOObjectImpl. Noted, which makes native-vs-non-native irrelevant for this bug. Therefore, Sabri, please clarify if you really encountered this problem using a *non-generated* model. The code snippets in your original report suggest that you were using the *generated* InventoryPackage.
Hi Caspar, Actually I reproduced with both *non-generated* and *generated* InventoryPackage. Best regards, Sabri.
Hi Sabri, as I cannot reproduce the issue with my attempts of creating a test case, could you attach a (preferrably minimum) zipped project so that I can reproduce the problem in that way? Thanks!
Created attachment 160197 [details] The project I used to reproduce the bug Process: 1. I start a run-time instance of Eclipse in order to have my inventory.cdo model loaded as a bundle. 2. I start a cdo server by the exercise 06 code 3. I open a CDO session UI view, I open a session to localhost and gastro repository 4. I try to import the resto1.inventory in a new resource and the exception occurs and even in the CDO UI Session the exception occurrs.
Rebasing all outstanding 3.0 problem reports to version 3.0.1
Fixing wrong bug version.
Moving all open problem reports to 4.0
Moving all open bug reports to 4.1 because the release is very near and it's hghly unlikely that there will be spare time to address 4.0 problems. Please make sure that your patches can be applied against the master branch and that your problem is not already fixed there!!!
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
We'll try to address open problems in 4.3 (master) first and then port fixes back to 4.2.
Moving all open bugzillas to 4.5.
Moving all unaddressed bugzillas to 4.6.
Moving all open bugs to 4.7
Moving all unresolved issues to version 4.8-
Moving all unresolved issues to version 4.9
Moving to 4.13.