Bug 41847

Summary: [PATCH] UnitOfWorkImpl.rollback() doesn't check before unlocking
Product: Lenya Reporter: Richard Frovarp <rfrovarp>
Component: MiscellaneousAssignee: Lenya Developers <dev>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: Trunk   
Target Milestone: 2.0.1   
Hardware: Other   
OS: other   
Attachments: Checks to make sure user has checked file out before unlocking

Description Richard Frovarp 2007-03-15 07:07:08 UTC
UnitOfWorkImpl.rollback() doesn't properly unlock the Transactionable t. Doing
some testing for another problem, t usually is a SourceNode. To get the lock to
work under a SourceNode it must be checked out by the current user. However,
rollback() unlocks anything that was locked, no matter who checked it out. The
patch protects the unlock by isCheckedOutByUser and unlocks it before checking
it in, which seems to be the proper order.
Comment 1 Richard Frovarp 2007-03-15 07:07:43 UTC
Created attachment 19710 [details]
Checks to make sure user has checked file out before unlocking
Comment 2 Andreas Hartmann 2007-03-19 02:29:04 UTC
Actually this shouldn't be necessary, since all transactionable objects should
be local to the UnitOfWorkObject, i.e. they are created by the current user.
Comment 3 Andreas Hartmann 2007-03-19 03:20:18 UTC
Would it be possible to create a test case for this bug?
Comment 4 Richard Frovarp 2007-03-19 11:26:00 UTC
I see it's changed. It used to be that any page that was visited was added to
the list. Which is why it is checking to make sure it is checked out by the
current user. It would appear that the issue has been cleared up. Although the
patch might make it clear as to what is going on and help guard against any
future issues. I'll leave it up to you to decide.
Comment 5 Andreas Hartmann 2007-04-26 06:11:58 UTC
I don't really dare to touch the repo layer now, let's schedule that for 1.4.1.
Comment 6 J 2007-04-26 06:34:13 UTC
+1