It's all about the answers!

Ask a question

Automatic unlock if a change set is discarded


Laura Venturini (661138) | asked Mar 03 '11, 7:20 a.m.
edited Oct 10 '17, 1:44 p.m. by David Lafreniere (4.8k7)

Hi
I need to implement the pessimistic lock, so I lock the source file at stream level.
If I discard the changes, I would expect that the lock on the resources is automatically removed, but it doesn' happen (the changes are discarded, but the file remains locked).
Is there a way to avoid this behaviour?
From my point of view, it's correct that the lock remain active if the change is suspendend, but if I discard the changes, it means that I want to go back to the previous status...
Is there a way to implement a plugin to perform this automatic unlock after a revert action?
Thank you for any suggestion
Laura

Accepted answer


permanent link
Tim Mok (6.6k38) | answered Mar 04 '11, 8:50 a.m.
JAZZ DEVELOPER
Hi
I need to implement the pessimistic lock, so I lock the source file at stream level.
If I discard the changes, I would expect that the lock on the resources is automatically removed, but it doesn' happen (the changes are discarded, but the file remains locked).
Is there a way to avoid this behaviour?
From my point of view, it's correct that the lock remain active if the change is suspendend, but if I discard the changes, it means that I want to go back to the previous status...
Is there a way to implement a plugin to perform this automatic unlock after a revert action?
Thank you for any suggestion
Laura
I think you'll have to open an enhancement on this. The discard operation doesn't have any support for dealing with locked versionables. It may be possible to write a plugin for this support but I'm not sure if you want to go that far unless pessimistic locking is essential.

You may want to check out the current enhancement and story items for a pessimistic locking model. You can add your support there.
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/89703
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/93617
David Lafreniere selected this answer as the correct answer

Your answer


Register or to post your answer.