check migration status without locking

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. 

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

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:

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

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

        changeLogHistoryService.init();

        if (updateExistingNullChecksums) {

            changeLogHistoryService.upgradeChecksums(databaseChangeLog, contexts);

        }

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

    }

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

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.