Could not release lock

Hi,


I am using the sqlfile tag as

   

    

     

   

  

 .


My SQL file have multiple GOs and is used to create a stored procedure. When this is run on SQL server, it runs successfully but then liquibase gives an exception as 

SEVERE 20/09/11 16:17:liquibase: Could not release lock

liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Could not find prepared statement with handle 1.


If I remove all the Go statements it works fine.


Kindly help with what needs to be done.


Thansk,

Divya

Can you run it with logLevel=DEBUG to get a stacktrace?

Nathan

Hi ,

I have the same problem but not solved by removing GO statement.
Here is my stacktrace :
SEVERE 1/4/12 5:25 PM:liquibase: Could not release lock
liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Could not find prepared statement with handle 1.
    at liquibase.lockservice.LockService.releaseLock(LockService.java:152)
    at liquibase.Liquibase.update(Liquibase.java:116)
    at liquibase.integration.commandline.Main.doMigration(Main.java:684)
    at liquibase.integration.commandline.Main.main(Main.java:116)
Caused by: liquibase.exception.UnexpectedLiquibaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Could not find prepared statement with handle 1.
    at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.hasTable(JdbcDatabaseSnapshotGenerator.java:63)
    at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.hasDatabaseChangeLogLockTable(JdbcDatabaseSnapshotGenerator.java:49)
    at liquibase.database.AbstractDatabase.hasDatabaseChangeLogLockTable(AbstractDatabase.java:481)
    at liquibase.lockservice.LockService.releaseLock(LockService.java:135)
    … 3 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Could not find prepared statement with handle 1.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1493)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:390)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:340)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
    at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQueryInternal(SQLServerPreparedStatement.java:296)
    at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetFromStoredProc(SQLServerDatabaseMetaData.java:284)
    at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetWithProvidedColumnNames(SQLServerDatabaseMetaData.java:300)
    at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getTables(SQLServerDatabaseMetaData.java:450)
    at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.hasTable(JdbcDatabaseSnapshotGenerator.java:54)
    … 6 more

Has anybody meet this issue ?

Regards,
Mohamed