SpringLiquibase releases lock even when liquibase could not acquire a lock.
Description
The SringLiquibase class is calling liquibase.forceReleaseLocks() in a finally clause. The reason that this is a problem is that if liquibase could not get a lock because another instance already has one for that database, that other lock is removed when the LockException is finally thrown.
Environment
None
Activity
Show:
Nathan Voxland September 8, 2011 at 5:59 AM
Applied pull. Thanks!
Quinton McCombs August 26, 2011 at 4:07 PM
pull request submitted
Quinton McCombs August 26, 2011 at 4:01 PM
I think that it would be safe to simply remove the section of code from the finally block in SpringLiquibase (lines 235 - 237 in liquibase 2.0.1) which handle the call to this method. The only place for an exception to be thrown after the lock is acquired (in liquibase.update() is already enclosed in a try/finally block which releases the lock.
The SringLiquibase class is calling liquibase.forceReleaseLocks() in a finally clause. The reason that this is a problem is that if liquibase could not get a lock because another instance already has one for that database, that other lock is removed when the LockException is finally thrown.