0
votes

I have my application deployed on tomcat7. It connects to the MySql DataBase in the backend. Where I have the DATABASECHANGELOG, its LOCK and User tables configured in the 'core' schema. When starting the tomcat server, I am facing the below issue.

INFO 7/9/14 11:04 AM:liquibase: Successfully acquired change log lock
INFO 7/9/14 11:04 AM:liquibase: Reading from partner.DATABASECHANGELOG
INFO 7/9/14 11:04 AM:liquibase: Reading from partner.DATABASECHANGELOG
WARNING 7/9/14 11:04 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case
INFO 7/9/14 11:04 AM:liquibase: Successfully released change log lock
INFO 7/9/14 11:04 AM:liquibase: Successfully acquired change log lock
INFO 7/9/14 11:04 AM:liquibase: Reading from core.DATABASECHANGELOG
INFO 7/9/14 11:04 AM:liquibase: Reading from core.DATABASECHANGELOG
WARNING 7/9/14 11:04 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case
WARNING 7/9/14 11:04 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case
WARNING 7/9/14 11:04 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case
WARNING 7/9/14 11:04 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case
WARNING 7/9/14 11:04 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case
WARNING 7/9/14 11:04 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case
INFO 7/9/14 11:04 AM:liquibase: Successfully released change log lock
INFO 7/9/14 11:04 AM:liquibase: Successfully acquired change log lock
INFO 7/9/14 11:04 AM:liquibase: Reading from partner.DATABASECHANGELOG
INFO 7/9/14 11:04 AM:liquibase: Reading from partner.DATABASECHANGELOG
WARNING 7/9/14 11:04 AM:liquibase: modifyDataType will lose primary key/autoincrement/not null settings for mysql. Use and re-specify all configuration if this is the case
INFO 7/9/14 11:04 AM:liquibase: Successfully released change log lock
...
14/09/07 11:04:49 INFO support.GenericXmlApplicationContext: Refreshing org.springframework.context.support.GenericXmlApplicationContext@771b9e: startup date [Sun Sep 07 11:04:49 IST 2014]; root of context hierarchy
14/09/07 11:04:49 INFO support.PropertySourcesPlaceholderConfigurer: Loading properties file from class path resource [jdbc.properties]
14/09/07 11:04:49 INFO support.DefaultListableBeanFactory: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@587dcb: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,entityManagerFactory,taxonomy.transaction.manager,taxonomy.datasource,taxonomy.liquibase]; root of factory hierarchy
14/09/07 11:04:49 INFO jpa.LocalContainerEntityManagerFactoryBean: Building JPA container EntityManagerFactory for persistence unit 'inference.taxonomy'
14/09/07 11:04:49 INFO ejb.Ejb3Configuration: HHH000204: Processing PersistenceUnitInfo [ name: inference.taxonomy
...]
14/09/07 11:04:49 INFO internal.ConnectionProviderInitiator: HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
14/09/07 11:04:49 INFO dialect.Dialect: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
14/09/07 11:04:50 INFO internal.TransactionFactoryInitiator: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
14/09/07 11:04:50 INFO ast.ASTQueryTranslatorFactory: HHH000397: Using ASTQueryTranslatorFactory
INFO 7/9/14 11:04 AM:liquibase: Waiting for changelog lock....
INFO 7/9/14 11:05 AM:liquibase: Waiting for changelog lock....
INFO 7/9/14 11:05 AM:liquibase: Waiting for changelog lock....
INFO 7/9/14 11:05 AM:liquibase: Waiting for changelog lock....
INFO 7/9/14 11:05 AM:liquibase: Waiting for changelog lock....
INFO 7/9/14 11:05 AM:liquibase: Waiting for changelog lock....
INFO 7/9/14 11:05 AM:liquibase: Waiting for changelog lock....
INFO 7/9/14 11:06 AM:liquibase: Waiting for changelog lock....
....
Caused by: liquibase.exception.LockException: Could not acquire change log lock. Currently locked by 10.1.202.X (10.1.202.X) since 5/9/14 11:23 PM
at liquibase.lockservice.LockService.waitForLock(LockService.java:81)
at liquibase.Liquibase.update(Liquibase.java:102)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:262)
atliquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:245)

At the DB level the DataBaseChangeLogLock table has locked field unlocked as shown below

ID , Locked, LockGranted, LockedBy

'1', '0', NULL, NULL

Even when why I remove all the DATABASECHANGELOG related tables before starting my server I am facing the same issue.

I don't find any resoution for this issue in Liquibase lock - reasons?

1
I think your application opens connection to the database after a startup, or maybe you forgot to close any opened by it JDBC connections. So Liquibase actually can't acquire lock, because it is acquired by your web-appication.Dmytro Plekhotkin

1 Answers

3
votes

It was resolved. The DATABASECHANGELOG table I was looking was in another schema "core.DATABASECHANGELOG", where as the lock acquired was in "platform.DATABASECHANGELOG".

Once I updated the correct Log table it was resolved.