Skip to main content



      Home
Home » Modeling » EMF » [CDO] Push transactions : Duplicate ID error when loading several changes made on the same element
[CDO] Push transactions : Duplicate ID error when loading several changes made on the same element [message #687411] Wed, 08 June 2011 03:46
Eclipse UserFriend
Hy everyone !

I've posted a question on the newsgroup using the web interface, but
apparently there is a bug and this post was not accessible through nntp
clients. Eike has raised a bug here :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=348449

My question can be found online :
http://www.eclipse.org/forums/index.php/mv/msg/210652/676753/#msg_676753

Just to be sure, I'll ask by question again :

I'm currently using CDOPushTransactions, which are great !

My use case seems to be the typical use case for Push Transactions :
I open a CDOPushTransaction, and commit changes in an hidden file. When
the user decides to, I push the changes on the repository.

It works like a charm, but I encountered a really annoying issue :
1. make several modifications (let us say modification of several
attributes) on a same CDOObject
2. commit the changes using my Push Transaction without pushing them
3. close the push transaction
4. open a new Push transaction so that changes made in 1 are loaded

I get the following error (MyElement being the EClass of my modified
element) :

java.lang.IllegalStateException: Duplicate ID: MyElement@OID14
	at 
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.registerNew(CDOTransactionImpl.java:1606)
	at 
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.registerDirty(CDOTransactionImpl.java:1594)
	at 
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.importChanges(CDOTransactionImpl.java:1885)
	at 
org.eclipse.emf.cdo.transaction.CDOPushTransaction.<init>(CDOPushTransaction.java:139)


When trying to commit anyway, I get the following error (which seems
logical):
org.eclipse.emf.cdo.util.CommitException: This transaction has conflicts
	at 
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1049)
	at 
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1078)


Considering the fact that any other modifications (element creation and
deletion, references or attributes changes...) are correctly persisted
and loaded, I'm thinking that it may be related to the CDO core and not
my code (which looks like the example given in this bugzilla record
https://bugs.eclipse.org/bugs/show_bug.cgi?id=297967).

Does this ring a bell to anyone ?

Thanks !
Alex

BTW : is there a clean way to avoid getting a warning ("Using [FILEPATH]
for push transaction ...") in the Error log each time a Push transaction
is created ?
Previous Topic:(no subject)
Next Topic:Re: [Teneo] Need ClassMetadata but it's not present
Goto Forum:
  


Current Time: Sun Jul 06 07:31:12 EDT 2025

Powered by FUDForum. Page generated in 0.24959 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top