Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] problems with savepoint and rollback
[CDO] problems with savepoint and rollback [message #501042] Mon, 30 November 2009 19:08 Go to next message
Eclipse UserFriend
Originally posted by: Thomas.Kowatsch.ruag.com

Hi.
I have the following scenario:

- open transaction
- modify object1
- create new object2 (gets attached somewhere)
- set savepoint
- remove object2
- do a rollback on the transaction (not the savepoint) to undo all
changes of the complete transaction.

Now it gives mea "nullPointerException" on rollback.
I stepped through the code and figured out the following:
- the transaction manages an internal "first savepoint"
- so on transaction rollback, it is first rolled back to my savepoint
set above
- this does actually nothing as detecting an detached object and storing
it in an internal collection
- the a rollback is done to the internal "firstSavepoint".
- this savepoint has still in its new objects collection the detached
object from savepoint before which is now tried to be removed, but
doesn't exist anymore...

Here is the exception:
ERROR Problems on rollback (UI) java.lang.NullPointerException
at
org.eclipse.emf.internal.cdo.view.CDOViewImpl.removeObject(C DOViewImpl.java:836)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. removeObjects(CDOTransactionImpl.java:691)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollbackCompletely(CDOTransactionImpl.java:715)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. handleRollback(CDOTransactionImpl.java:967)
at
org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio nStrategyImpl.rollback(CDOSingleTransactionStrategyImpl.java :77)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:929)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:680)

Am I doing something wrong? Or is it actually a bug?

Cheers.
--Thomas

P.S.: I'm using the cdo code from HEAD (exported friday or today) at the
moment....
Re: [CDO] problems with savepoint and rollback [message #501155 is a reply to message #501042] Tue, 01 December 2009 11:02 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Hi Thomas,

this is probably a bug due to:

290726: Provide ResourceImpl.ModificationTrackingAdapter emulation
https://bugs.eclipse.org/bugs/show_bug.cgi?id=290726

Eike identified some scenarios where rollback might not work, but I
couldn't have time to fix it. Maybe its the same problem you've
identified. I'll try to create a test-case and see whether its related
with this bugzilla or not.

Cheers,
Víctor.


Thomas Kowatsch escribió:
> Hi.
> I have the following scenario:
>
> - open transaction
> - modify object1
> - create new object2 (gets attached somewhere)
> - set savepoint
> - remove object2
> - do a rollback on the transaction (not the savepoint) to undo all
> changes of the complete transaction.
>
> Now it gives mea "nullPointerException" on rollback.
> I stepped through the code and figured out the following:
> - the transaction manages an internal "first savepoint"
> - so on transaction rollback, it is first rolled back to my savepoint
> set above
> - this does actually nothing as detecting an detached object and storing
> it in an internal collection
> - the a rollback is done to the internal "firstSavepoint".
> - this savepoint has still in its new objects collection the detached
> object from savepoint before which is now tried to be removed, but
> doesn't exist anymore...
>
> Here is the exception:
> ERROR Problems on rollback (UI) java.lang.NullPointerException
> at
> org.eclipse.emf.internal.cdo.view.CDOViewImpl.removeObject(C DOViewImpl.java:836)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. removeObjects(CDOTransactionImpl.java:691)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollbackCompletely(CDOTransactionImpl.java:715)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. handleRollback(CDOTransactionImpl.java:967)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio nStrategyImpl.rollback(CDOSingleTransactionStrategyImpl.java :77)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:929)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:680)
>
>
> Am I doing something wrong? Or is it actually a bug?
>
> Cheers.
> --Thomas
>
> P.S.: I'm using the cdo code from HEAD (exported friday or today) at the
> moment....
Re: [CDO] problems with savepoint and rollback [message #501163 is a reply to message #501042] Tue, 01 December 2009 11:16 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Thomas,

from what I see in the code, I looks like a bug, and I think is not
related with bug 290726. Could you please raise a bugzilla? I have
already created a test-case, so I'll submit it as soon as the bugzilla
gets created :)

Cheers,
Víctor.

Thomas Kowatsch escribió:
> Hi.
> I have the following scenario:
>
> - open transaction
> - modify object1
> - create new object2 (gets attached somewhere)
> - set savepoint
> - remove object2
> - do a rollback on the transaction (not the savepoint) to undo all
> changes of the complete transaction.
>
> Now it gives mea "nullPointerException" on rollback.
> I stepped through the code and figured out the following:
> - the transaction manages an internal "first savepoint"
> - so on transaction rollback, it is first rolled back to my savepoint
> set above
> - this does actually nothing as detecting an detached object and storing
> it in an internal collection
> - the a rollback is done to the internal "firstSavepoint".
> - this savepoint has still in its new objects collection the detached
> object from savepoint before which is now tried to be removed, but
> doesn't exist anymore...
>
> Here is the exception:
> ERROR Problems on rollback (UI) java.lang.NullPointerException
> at
> org.eclipse.emf.internal.cdo.view.CDOViewImpl.removeObject(C DOViewImpl.java:836)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. removeObjects(CDOTransactionImpl.java:691)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollbackCompletely(CDOTransactionImpl.java:715)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. handleRollback(CDOTransactionImpl.java:967)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio nStrategyImpl.rollback(CDOSingleTransactionStrategyImpl.java :77)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:929)
>
> at
> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:680)
>
>
> Am I doing something wrong? Or is it actually a bug?
>
> Cheers.
> --Thomas
>
> P.S.: I'm using the cdo code from HEAD (exported friday or today) at the
> moment....
Re: [CDO] problems with savepoint and rollback [message #501167 is a reply to message #501163] Tue, 01 December 2009 11:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Thomas.Kowatsch.ruag.com

Hi Victor.
Filed the bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=296561
Cheers for help.
--Thomas

Víctor Roldán Betancort schrieb:
> Thomas,
>
> from what I see in the code, I looks like a bug, and I think is not
> related with bug 290726. Could you please raise a bugzilla? I have
> already created a test-case, so I'll submit it as soon as the bugzilla
> gets created :)
>
> Cheers,
> Víctor.
>
> Thomas Kowatsch escribió:
>> Hi.
>> I have the following scenario:
>>
>> - open transaction
>> - modify object1
>> - create new object2 (gets attached somewhere)
>> - set savepoint
>> - remove object2
>> - do a rollback on the transaction (not the savepoint) to undo all
>> changes of the complete transaction.
>>
>> Now it gives mea "nullPointerException" on rollback.
>> I stepped through the code and figured out the following:
>> - the transaction manages an internal "first savepoint"
>> - so on transaction rollback, it is first rolled back to my savepoint
>> set above
>> - this does actually nothing as detecting an detached object and
>> storing it in an internal collection
>> - the a rollback is done to the internal "firstSavepoint".
>> - this savepoint has still in its new objects collection the detached
>> object from savepoint before which is now tried to be removed, but
>> doesn't exist anymore...
>>
>> Here is the exception:
>> ERROR Problems on rollback (UI) java.lang.NullPointerException
>> at
>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.removeObject(C DOViewImpl.java:836)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. removeObjects(CDOTransactionImpl.java:691)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollbackCompletely(CDOTransactionImpl.java:715)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. handleRollback(CDOTransactionImpl.java:967)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio nStrategyImpl.rollback(CDOSingleTransactionStrategyImpl.java :77)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:929)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:680)
>>
>>
>> Am I doing something wrong? Or is it actually a bug?
>>
>> Cheers.
>> --Thomas
>>
>> P.S.: I'm using the cdo code from HEAD (exported friday or today) at
>> the moment....
Re: [CDO] problems with savepoint and rollback [message #501174 is a reply to message #501167] Tue, 01 December 2009 12:09 Go to previous message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Thanks Thomas,

I've just submitted a testcase. I'll invest some time on the bug.

Cheers,
Víctor.

Thomas Kowatsch escribió:
> Hi Victor.
> Filed the bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=296561
> Cheers for help.
> --Thomas
>
> Víctor Roldán Betancort schrieb:
>> Thomas,
>>
>> from what I see in the code, I looks like a bug, and I think is not
>> related with bug 290726. Could you please raise a bugzilla? I have
>> already created a test-case, so I'll submit it as soon as the bugzilla
>> gets created :)
>>
>> Cheers,
>> Víctor.
>>
>> Thomas Kowatsch escribió:
>>> Hi.
>>> I have the following scenario:
>>>
>>> - open transaction
>>> - modify object1
>>> - create new object2 (gets attached somewhere)
>>> - set savepoint
>>> - remove object2
>>> - do a rollback on the transaction (not the savepoint) to undo all
>>> changes of the complete transaction.
>>>
>>> Now it gives mea "nullPointerException" on rollback.
>>> I stepped through the code and figured out the following:
>>> - the transaction manages an internal "first savepoint"
>>> - so on transaction rollback, it is first rolled back to my savepoint
>>> set above
>>> - this does actually nothing as detecting an detached object and
>>> storing it in an internal collection
>>> - the a rollback is done to the internal "firstSavepoint".
>>> - this savepoint has still in its new objects collection the detached
>>> object from savepoint before which is now tried to be removed, but
>>> doesn't exist anymore...
>>>
>>> Here is the exception:
>>> ERROR Problems on rollback (UI) java.lang.NullPointerException
>>> at
>>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.removeObject(C DOViewImpl.java:836)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. removeObjects(CDOTransactionImpl.java:691)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollbackCompletely(CDOTransactionImpl.java:715)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. handleRollback(CDOTransactionImpl.java:967)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactio nStrategyImpl.rollback(CDOSingleTransactionStrategyImpl.java :77)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:929)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl. rollback(CDOTransactionImpl.java:680)
>>>
>>>
>>> Am I doing something wrong? Or is it actually a bug?
>>>
>>> Cheers.
>>> --Thomas
>>>
>>> P.S.: I'm using the cdo code from HEAD (exported friday or today) at
>>> the moment....
Previous Topic:tranisent reference
Next Topic:EMF editor : Cross references with platform URIs
Goto Forum:
  


Current Time: Sat Nov 23 02:34:59 GMT 2019

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

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

Back to the top