Liquibase Maven Plugin with DB user having readonly privileges

Hi,

  I am using liquibase maven plugin 2.0.1.(JDK1.6.) with MSSQLServer 2008.

I am trying to generate SQL script using updateSQL goal and i am getting following exception. 

  It is trying to update the DATBASECHANGELOCK table even while generating SQL script.

Same thing works fine when i try to execute it with commandline approach without any exception. We will have user with Readonly access on PROD.

  Is it liquibase maven plugin issue?

 

 

INFO 9/12/11 7:51 AM:liquibase: ChangeSet ch_6
000.xml::1::x658894 ran successfully in 15ms
INFO 9/12/11 7:51 AM:liquibase: ChangeSet ch_6
101.xml::1::x658894 ran successfully in 0ms
INFO 9/12/11 7:51 AM:liquibase: Successfully released change log lock
INFO 9/12/11 7:51 AM:liquibase: Successfully released change log lock
[ERROR] liquibase.exception.DatabaseException: Error executing SQL UPDATE [dbo].[DATABASEC
HANGELOGLOCK]
SET [LOCKED] = 0, [LOCKEDBY] = NULL, [LOCKGRANTED] = NULL WHERE [ID] = 1: Th
e UPDATE permission was denied on the object ‘DATABASECHANGELOGLOCK’, database ‘temp’, schema ‘dbo’.
liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing
SQL UPDATE [dbo].[DATABASECHANGELOGLOCK] SET [LOCKED] = 0, [LOCKEDBY] = NULL, [LOCKGRANTED
] = NULL WHERE [ID] = 1: The UPDATE permission was denied on the object ‘DATABASECHANGELOG
LOCK’,
database temp

        at liquibase.lockservice.LockService.releaseLock(LockService.java:152)
        at liquibase.lockservice.LockService.forceReleaseLock(LockService.java:194)
        at liquibase.Liquibase.forceReleaseLocks(Liquibase.java:575)
        at org.liquibase.maven.plugins.AbstractLiquibaseMojo.cleanup(AbstractLiquibaseMojo

 

 

 

 

 

 

 

 

 

 

 

 

Thanks in advance,

Rahul

Is is a problem with liquibase which should be fixed in the 2.0.2 release. For 2.0.1, it expects a user that can at least write to the databasechangeloglock table.


Nathan

Thanks for your quick reply.

  When i execute the liquibase with maven updateSQL it does generate the SQL scripts properly. Even if you look at the logs i have posted above, it has succeeded in generating SQL scripts. It is printing exception stacktrace when it tries to reset the lock with update query on DATBASECHANGELOGLOCK table. This is supressed exception inside AbstractLiquibaseMojo.cleanup() method.

  If i want to continue using a databse user with readonly permission(due to our process guidelines for Production),

 

Question -1.Can i just ignore this supressed exception and use liquibase with user having readonly permission?

 

   2. DO you think if i use liquibase in the above way(mentioned in 1) it will affect our expected output i.e. SQL script generated by liquibase?

 

  Your reply is going to be very crucial for us.

 

Thanks,

Rahul Patil

 

 

This shoudl be fixed in the 2.0.2 release


Nathan