Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 #687160] Wed, 08 June 2011 07:46 Go to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

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 ?
Re: [CDO] Push transactions : Duplicate ID error when loading several changes made on the same eleme [message #687162 is a reply to message #687160] Wed, 08 June 2011 10:55 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Alex,

I've added two new test cases:

org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectBetweenReloadAndPush()
org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectTwiceBetweenReloadAndPush()

But I can not produce any test failure. Can you look at these tests and modify them so that they fail? If you can make them fail, please submit a bugzilla and attach a patch of your changes.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 08.06.2011 09:46, schrieb Alex Lagarde:
> 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 ?


Re: [CDO] Push transactions : Duplicate ID error when loading several changes made on the same eleme [message #687196 is a reply to message #687162] Tue, 14 June 2011 10:55 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Hi Eike,

thanks for your reply. After having updated my TP and reproduced the
issue on the latest CDO version (RC4c contribution candidate), I took a
look on the tests you added and I noticed that you are always using the
"true" value for the boolean "reconstructSavepoints" to construct
CDOPushTransactions. By changing all constructors in my code, it works fine.

I did not think I had to do this, (maybe a little lack of documentation
here), can you explain the purpose of this boolean ? It seems that when
building CDOPushTransactions with the "false" value, importing existing
changes from a file fails in the previously described use cases.

Thanks again !
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 ?


Le 08/06/2011 12:55, Eike Stepper a écrit :
> Hi Alex,
>
> I've added two new test cases:
>
> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectBetweenReloadAndPush()
>
> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectTwiceBetweenReloadAndPush()
>
>
> But I can not produce any test failure. Can you look at these tests and
> modify them so that they fail? If you can make them fail, please submit
> a bugzilla and attach a patch of your changes.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 08.06.2011 09:46, schrieb Alex Lagarde:
>> 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 ?
Re: [CDO] Push transactions : Duplicate ID error when loading several changes made on the same eleme [message #687197 is a reply to message #687196] Tue, 14 June 2011 11:54 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 14.06.2011 12:55, schrieb Alex Lagarde:
> Hi Eike,
>
> thanks for your reply. After having updated my TP and reproduced the issue on the latest CDO version (RC4c contribution candidate), I took a look on the tests you added and I noticed that you are always using the "true" value for the boolean "reconstructSavepoints" to construct CDOPushTransactions. By changing all constructors in my code, it works fine.
Good that it works for you. Can you please remind me with a bugzilla that reconstructSavepoints==false is troublesome? I'm currently too busy with release preps...


>
> I did not think I had to do this, (maybe a little lack of documentation here), can you explain the purpose of this boolean ?
When a push transaction commits, i.e. calls delegate.exportChanges(), then all the save points of the push transaction are written to the file, one change set per save point. Later, when you open a new push transaction on that file you can decide whether to delegate.importChanges() and reconstruct those save points or compress them into a single change set (which doesn't seem to work properly for you, but is not the default).

> It seems that when building CDOPushTransactions with the "false" value, importing existing changes from a file fails in the previously described use cases.
>
> Thanks again !
> 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 ?
You may file a bugzilla to remind me to change that code to use an OMTracer rather than an OMLogger . In the meantime you could only replace the EclipseLoggingBridge with a custom version that filters the log messages according to your needs.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



>
>
> Le 08/06/2011 12:55, Eike Stepper a écrit :
>> Hi Alex,
>>
>> I've added two new test cases:
>>
>> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectBetweenReloadAndPush()
>>
>> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectTwiceBetweenReloadAndPush()
>>
>>
>> But I can not produce any test failure. Can you look at these tests and
>> modify them so that they fail? If you can make them fail, please submit
>> a bugzilla and attach a patch of your changes.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 08.06.2011 09:46, schrieb Alex Lagarde:
>>> 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 ?
>


Re: [CDO] Push transactions : Duplicate ID error when loading several changes made on the same eleme [message #687415 is a reply to message #687160] Wed, 08 June 2011 10:55 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Alex,

I've added two new test cases:

org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectBetweenReloadAndPush()
org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectTwiceBetweenReloadAndPush()

But I can not produce any test failure. Can you look at these tests and modify them so that they fail? If you can make them fail, please submit a bugzilla and attach a patch of your changes.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 08.06.2011 09:46, schrieb Alex Lagarde:
> 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 ?


Re: [CDO] Push transactions : Duplicate ID error when loading several changes made on the same eleme [message #687459 is a reply to message #687162] Tue, 14 June 2011 10:55 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Hi Eike,

thanks for your reply. After having updated my TP and reproduced the
issue on the latest CDO version (RC4c contribution candidate), I took a
look on the tests you added and I noticed that you are always using the
"true" value for the boolean "reconstructSavepoints" to construct
CDOPushTransactions. By changing all constructors in my code, it works fine.

I did not think I had to do this, (maybe a little lack of documentation
here), can you explain the purpose of this boolean ? It seems that when
building CDOPushTransactions with the "false" value, importing existing
changes from a file fails in the previously described use cases.

Thanks again !
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 ?


Le 08/06/2011 12:55, Eike Stepper a écrit :
> Hi Alex,
>
> I've added two new test cases:
>
> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectBetweenReloadAndPush()
>
> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectTwiceBetweenReloadAndPush()
>
>
> But I can not produce any test failure. Can you look at these tests and
> modify them so that they fail? If you can make them fail, please submit
> a bugzilla and attach a patch of your changes.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 08.06.2011 09:46, schrieb Alex Lagarde:
>> 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 ?
Re: [CDO] Push transactions : Duplicate ID error when loading several changes made on the same eleme [message #687460 is a reply to message #687196] Tue, 14 June 2011 11:54 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 14.06.2011 12:55, schrieb Alex Lagarde:
> Hi Eike,
>
> thanks for your reply. After having updated my TP and reproduced the issue on the latest CDO version (RC4c contribution candidate), I took a look on the tests you added and I noticed that you are always using the "true" value for the boolean "reconstructSavepoints" to construct CDOPushTransactions. By changing all constructors in my code, it works fine.
Good that it works for you. Can you please remind me with a bugzilla that reconstructSavepoints==false is troublesome? I'm currently too busy with release preps...


>
> I did not think I had to do this, (maybe a little lack of documentation here), can you explain the purpose of this boolean ?
When a push transaction commits, i.e. calls delegate.exportChanges(), then all the save points of the push transaction are written to the file, one change set per save point. Later, when you open a new push transaction on that file you can decide whether to delegate.importChanges() and reconstruct those save points or compress them into a single change set (which doesn't seem to work properly for you, but is not the default).

> It seems that when building CDOPushTransactions with the "false" value, importing existing changes from a file fails in the previously described use cases.
>
> Thanks again !
> 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 ?
You may file a bugzilla to remind me to change that code to use an OMTracer rather than an OMLogger . In the meantime you could only replace the EclipseLoggingBridge with a custom version that filters the log messages according to your needs.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



>
>
> Le 08/06/2011 12:55, Eike Stepper a écrit :
>> Hi Alex,
>>
>> I've added two new test cases:
>>
>> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectBetweenReloadAndPush()
>>
>> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectTwiceBetweenReloadAndPush()
>>
>>
>> But I can not produce any test failure. Can you look at these tests and
>> modify them so that they fail? If you can make them fail, please submit
>> a bugzilla and attach a patch of your changes.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 08.06.2011 09:46, schrieb Alex Lagarde:
>>> 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 ?
>


Re: [CDO] Push transactions : Duplicate ID error when loading several changes made on the same eleme [message #697007 is a reply to message #687197] Fri, 15 July 2011 09:42 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Opened bugzilla for the reconstructSavePoint == false use case :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352189

I've replaced the LoggingBridge used by my app as you suggested, to
avoid filling the Error log with info messages any time a
PushTransaction is opened, works perfectly, thanks again.

Alex

Le 14/06/2011 13:54, Eike Stepper a écrit :
> Am 14.06.2011 12:55, schrieb Alex Lagarde:
>> Hi Eike,
>>
>> thanks for your reply. After having updated my TP and reproduced the
>> issue on the latest CDO version (RC4c contribution candidate), I took
>> a look on the tests you added and I noticed that you are always using
>> the "true" value for the boolean "reconstructSavepoints" to construct
>> CDOPushTransactions. By changing all constructors in my code, it works
>> fine.
> Good that it works for you. Can you please remind me with a bugzilla
> that reconstructSavepoints==false is troublesome? I'm currently too busy
> with release preps...
>
>
>>
>> I did not think I had to do this, (maybe a little lack of
>> documentation here), can you explain the purpose of this boolean ?
> When a push transaction commits, i.e. calls delegate.exportChanges(),
> then all the save points of the push transaction are written to the
> file, one change set per save point. Later, when you open a new push
> transaction on that file you can decide whether to
> delegate.importChanges() and reconstruct those save points or compress
> them into a single change set (which doesn't seem to work properly for
> you, but is not the default).
>
>> It seems that when building CDOPushTransactions with the "false"
>> value, importing existing changes from a file fails in the previously
>> described use cases.
>>
>> Thanks again !
>> 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 ?
> You may file a bugzilla to remind me to change that code to use an
> OMTracer rather than an OMLogger . In the meantime you could only
> replace the EclipseLoggingBridge with a custom version that filters the
> log messages according to your needs.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
>>
>>
>> Le 08/06/2011 12:55, Eike Stepper a écrit :
>>> Hi Alex,
>>>
>>> I've added two new test cases:
>>>
>>> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectBetweenReloadAndPush()
>>>
>>>
>>> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectTwiceBetweenReloadAndPush()
>>>
>>>
>>>
>>> But I can not produce any test failure. Can you look at these tests and
>>> modify them so that they fail? If you can make them fail, please submit
>>> a bugzilla and attach a patch of your changes.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 08.06.2011 09:46, schrieb Alex Lagarde:
>>>> 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 ?
>>
Re: [CDO] Push transactions : Duplicate ID error when loading several changes made on the same eleme [message #726664 is a reply to message #697007] Mon, 19 September 2011 08:21 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 15.07.2011 11:42, schrieb Alex Lagarde:
> I've replaced the LoggingBridge used by my app as you suggested, to avoid filling the Error log with info messages any
> time a PushTransaction is opened, works perfectly, thanks again.
This is now even more convenient:

358069: Provide log event filtering hook
https://bugs.eclipse.org/bugs/show_bug.cgi?id=358069

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Alex
>
> Le 14/06/2011 13:54, Eike Stepper a écrit :
>> Am 14.06.2011 12:55, schrieb Alex Lagarde:
>>> Hi Eike,
>>>
>>> thanks for your reply. After having updated my TP and reproduced the
>>> issue on the latest CDO version (RC4c contribution candidate), I took
>>> a look on the tests you added and I noticed that you are always using
>>> the "true" value for the boolean "reconstructSavepoints" to construct
>>> CDOPushTransactions. By changing all constructors in my code, it works
>>> fine.
>> Good that it works for you. Can you please remind me with a bugzilla
>> that reconstructSavepoints==false is troublesome? I'm currently too busy
>> with release preps...
>>
>>
>>>
>>> I did not think I had to do this, (maybe a little lack of
>>> documentation here), can you explain the purpose of this boolean ?
>> When a push transaction commits, i.e. calls delegate.exportChanges(),
>> then all the save points of the push transaction are written to the
>> file, one change set per save point. Later, when you open a new push
>> transaction on that file you can decide whether to
>> delegate.importChanges() and reconstruct those save points or compress
>> them into a single change set (which doesn't seem to work properly for
>> you, but is not the default).
>>
>>> It seems that when building CDOPushTransactions with the "false"
>>> value, importing existing changes from a file fails in the previously
>>> described use cases.
>>>
>>> Thanks again !
>>> 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 ?
>> You may file a bugzilla to remind me to change that code to use an
>> OMTracer rather than an OMLogger . In the meantime you could only
>> replace the EclipseLoggingBridge with a custom version that filters the
>> log messages according to your needs.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>>>
>>>
>>> Le 08/06/2011 12:55, Eike Stepper a écrit :
>>>> Hi Alex,
>>>>
>>>> I've added two new test cases:
>>>>
>>>> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectBetweenReloadAndPush()
>>>>
>>>>
>>>> org.eclipse.emf.cdo.tests.PushTransactionTest.testAddNewObjectInObjectTwiceBetweenReloadAndPush()
>>>>
>>>>
>>>>
>>>> But I can not produce any test failure. Can you look at these tests and
>>>> modify them so that they fail? If you can make them fail, please submit
>>>> a bugzilla and attach a patch of your changes.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 08.06.2011 09:46, schrieb Alex Lagarde:
>>>>> 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:EMF Validation
Next Topic:Working with generated code
Goto Forum:
  


Current Time: Sat Apr 27 02:15:13 GMT 2024

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

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

Back to the top