# Two processes running Liquibase against the same Db

**URL:** <https://forum.liquibase.org/t/two-processes-running-liquibase-against-the-same-db/544>\
**Category:** General Discussion\
**Created:** [June 10, 2010, 10:05pm UTC](https://forum.liquibase.org/t/two-processes-running-liquibase-against-the-same-db/544 "2010-06-10T22:05:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradley\_lb](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bradley\_lb](https://forum.liquibase.org/u/bradley_lb)\
**Post date:** [June 10, 2010, 10:05pm UTC](https://forum.liquibase.org/t/two-processes-running-liquibase-against-the-same-db/544/1 "2010-06-10T22:05:00Z")

</div>

I have two Tomcat instances running load balanced agains the same db. Ocassionally, when starting them around the same time I’ll see one hang indefinitely with the error message:

Waiting for changelog lock....
every 10s. I did some debugging of this and found the LockHandler#acquireLock method attempting to query the log lock table for the value of the LOCKED column. I saw it coming back as "locked" over and over again even though when I looked in the database the LOCKED column was clearly 0 for the record with ID=1.

What gives?

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [June 10, 2010, 10:05pm UTC](https://forum.liquibase.org/t/two-processes-running-liquibase-against-the-same-db/544/2 "2010-06-10T22:05:00Z")

</div>

Are you running version 1.9.x ?&nbsp; The point of the databasechangeloglock is to to stop errors when you have two databases trying to update the same database at the same time.&nbsp;

There was an error in later 1.9 builds (don’t know when it was introduced exactly) that broke the logic for it to see the database lock was released.&nbsp; It is fixed in the upcoming 2.0 release and I’m hoping to get the fix backported to the 1.9 builds, but it’s not in there yet.

Nathan

---

<div class="post-metadata">

**Author:** ![bradley\_lb](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bradley\_lb](https://forum.liquibase.org/u/bradley_lb)\
**Post date:** [June 10, 2010, 10:05pm UTC](https://forum.liquibase.org/t/two-processes-running-liquibase-against-the-same-db/544/3 "2010-06-10T22:05:00Z")

</div>

Yes, we’re running 1.9.4.

What you’re describing is exactly what we’re seeing. The query to check if the database is locked seems to be returning a false positive. I can’t tell if it’s using a cache connection, result set or what.

Is there an issue I can track?

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [June 10, 2010, 10:05pm UTC](https://forum.liquibase.org/t/two-processes-running-liquibase-against-the-same-db/544/4 "2010-06-10T22:05:00Z")

</div>

I don’t think there is a bug for it, it was something I saw in 2.0 and thought may be specific to that codebase.&nbsp; I think it was a problem with reading from the same transaction to check the state of the column.&nbsp;

Could you open a bug on [liquibase.jira.com](http://liquibase.jira.com) for the 1.9 branch?

Nathan

---

<div class="post-metadata">

**Author:** ![bradley\_lb](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@bradley\_lb](https://forum.liquibase.org/u/bradley_lb)\
**Post date:** [June 10, 2010, 10:05pm UTC](https://forum.liquibase.org/t/two-processes-running-liquibase-against-the-same-db/544/5 "2010-06-10T22:05:00Z")

</div>

Filed: [http://liquibase.jira.com/browse/CORE-632.](http://liquibase.jira.com/browse/CORE-632.) Thanks!
