Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321986 - NPE on rollbacking detached objects
Summary: NPE on rollbacking detached objects
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Caspar D. CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-06 09:57 EDT by Egidijus Vaisnora CLA
Modified: 2011-06-23 03:40 EDT (History)
3 users (show)

See Also:
stepper: review+


Attachments
Test case (2.32 KB, patch)
2010-08-06 10:00 EDT, Egidijus Vaisnora CLA
no flags Details | Diff
Patch (including testcase) (3.92 KB, patch)
2011-03-10 22:35 EST, Caspar D. CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Egidijus Vaisnora CLA 2010-08-06 09:57:13 EDT
I have two different transactions (t1 and t2), created from the different sessions and object o1
1.  on t1 detach o1
2. ti.commit, with commit failure
3. on t2 detach o1
4. t2.commit with success
5. t1.rollback

I get NPE exception:
java.lang.NullPointerException
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.cleanObject(CDOViewImpl.java:925)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.rollbackCompletely(CDOTransactionImpl.java:772)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.handleRollback(CDOTransactionImpl.java:984)
	at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.rollback(CDOSingleTransactionStrategyImpl.java:77)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.rollback(CDOTransactionImpl.java:946)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.rollback(CDOTransactionImpl.java:687)
Comment 1 Egidijus Vaisnora CLA 2010-08-06 10:00:52 EDT
Created attachment 176035 [details]
Test case
Comment 2 Egidijus Vaisnora CLA 2010-08-06 10:27:08 EDT
Changed component. 

On repository object is removed, while locally object is detached. Rollback attempts to restore detached locally element by obtaining revision from server, but revision from server comes null as it was already deleted.
Comment 3 Eike Stepper CLA 2010-11-16 01:03:23 EST
Changing version to 3.0.

Let's only use major versions to indicate the development stream. If more precise baseline info is needed let's insert a time stamp in a comment.
Comment 4 Laurent Goubet CLA 2011-03-10 10:06:55 EST
Changing assignee to emf.cdo-inbox@eclipse.org instead of EMF Compare.
Comment 5 Caspar D. CLA 2011-03-10 22:35:08 EST
Created attachment 190952 [details]
Patch (including testcase)

Using cleanRevisions instead of fetching clean revision from server.
Comment 6 Eike Stepper CLA 2011-03-15 06:19:12 EDT
Committed revision 7536:
- trunk/plugins/org.eclipse.emf.cdo
- trunk/plugins/org.eclipse.emf.cdo.tests
Comment 7 Eike Stepper CLA 2011-03-15 06:19:30 EDT
Resolving for Caspar...
Comment 8 Eike Stepper CLA 2011-06-23 03:40:27 EDT
Available in R20110608-1407