Bug 41847 - [PATCH] UnitOfWorkImpl.rollback() doesn't check before unlocking
Summary: [PATCH] UnitOfWorkImpl.rollback() doesn't check before unlocking
Status: NEW
Alias: None
Product: Lenya
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: Trunk
Hardware: Other other
: P2 normal
Target Milestone: 2.0.1
Assignee: Lenya Developers
Depends on:
Reported: 2007-03-15 07:07 UTC by Richard Frovarp
Modified: 2007-07-16 02:30 UTC (History)
0 users

Checks to make sure user has checked file out before unlocking (815 bytes, patch)
2007-03-15 07:07 UTC, Richard Frovarp
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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