Problem when using Liquibase API for Derby database

When I try to use the Liquibase API (liquibase.update) directly in the java code I got the follwowing error msg:

Error executing SQL UPDATE DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = 'fe80:0:0:0:20c:29ff:fed6:8779%2 (fe80:0:0:0:20c:29ff:fed6:8779%2)', LOCKGRANTED = TIMESTAMP('2011-11-08 09:04:43.379000') WHERE ID = 1 AND LOCKED = FALSE: Syntax error: TRUE.
 at liquibase.lockservice.LockService.acquireLock(
 at liquibase.lockservice.LockService.waitForLock(
 at liquibase.Liquibase.update(

The reason for the error I believe is because the class UnlockDatabaseChangeLogGenerator tries to update the column LOCKED, which is defined as SMALLINT, in the table DATABASECHANGELOGLOC with TRUE and not with '1'. I guess his will work fine for the most databaseses, but not for Derby.


We are using version 2.0.2 of Liquibase.

By normal use of Liquibase its work fine for Derby. The reason for using the API in the java code was to initalise the database in connection with Junit testing. For Oracle database this use of the API works fine.

That does look like the problem. What version of liquibase are you running?

I would have expected to catch that in the normal liquibase usage/testing, not just using the api