[CDO] problems with savepoint and rollback [message #501042] |
Mon, 30 November 2009 19:08 |
Eclipse User |
|
|
|
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 #501167 is a reply to message #501163] |
Tue, 01 December 2009 11:38 |
Eclipse User |
|
|
|
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 |
Victor Roldan Betancort 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....
|
|
|
Powered by
FUDForum. Page generated in 0.06044 seconds