# check migration status without locking

**URL:** <https://forum.liquibase.org/t/check-migration-status-without-locking/3074>\
**Category:** General Discussion\
**Created:** [August 6, 2014, 6:15pm UTC](https://forum.liquibase.org/t/check-migration-status-without-locking/3074 "2014-08-06T18:15:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![logemann](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@logemann](https://forum.liquibase.org/u/logemann)\
**Post date:** [August 6, 2014, 6:15pm UTC](https://forum.liquibase.org/t/check-migration-status-without-locking/3074/1 "2014-08-06T18:15:00Z")

</div>

Hi,

i am using Liquibase via API aka Liquibase.class. Currently i am checking at login time if a DB upgrade is needed with listUnrunChangeSets(). This creates a lock for each check. Because this is only a readonly call which doesnt need a lock, i am wondering if there is a call which only tells me if everything is in sync, w/o creating a lock.&nbsp;

We have massive Problems with left-over locks in a cluster setting, where we restart seperate nodes on a cluster (sometime even with kill -9)

So a read only sync check without a lock would be HUGHE for us.

Marc

---

<div class="post-metadata">

**Author:** ![logemann](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@logemann](https://forum.liquibase.org/u/logemann)\
**Post date:** [August 6, 2014, 6:15pm UTC](https://forum.liquibase.org/t/check-migration-status-without-locking/3074/2 "2014-08-06T18:15:00Z")

</div>

some more info from me. I just digged through the code. I simply dont understand why a read-only operation like “listUnrunChangeSets” calls this method:

&nbsp; &nbsp; public void checkLiquibaseTables(boolean updateExistingNullChecksums, DatabaseChangeLog databaseChangeLog, Contexts contexts) throws LiquibaseException {

&nbsp; &nbsp; &nbsp; &nbsp; ChangeLogHistoryService changeLogHistoryService = ChangeLogHistoryServiceFactory.getInstance().getChangeLogService(getDatabase());

&nbsp; &nbsp; &nbsp; &nbsp; changeLogHistoryService.init();

&nbsp; &nbsp; &nbsp; &nbsp; if (updateExistingNullChecksums) {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; changeLogHistoryService.upgradeChecksums(databaseChangeLog, contexts);

&nbsp; &nbsp; &nbsp; &nbsp; }

&nbsp; &nbsp; &nbsp; &nbsp; LockServiceFactory.getInstance().getLockService(getDatabase()).init();

&nbsp; &nbsp; }

Or differently asked, why does this method includes “creating” a lock? Is there any reason someone needs to create a lock only for “getting” unrun changesets? I mean, i understand that you need to protected “update()” method calls, but why this read-only call?

Marc

---

<div class="post-metadata">

**Author:** ![logemann](https://avatars.discourse-cdn.com/v4/letter/l/da6949/32.png) [@logemann](https://forum.liquibase.org/u/logemann)\
**Post date:** [August 6, 2014, 6:15pm UTC](https://forum.liquibase.org/t/check-migration-status-without-locking/3074/3 "2014-08-06T18:15:00Z")

</div>

I see that we are using a pretty old Liqibase (1.9.x) and that at least with 3.1.x the listUnrunChangeSets() no longer has a waitForLock() call.

Perhaps i am chasing a phantom because of old version.
