OpenClinica User Manual/ChangeLogLock

Waiting for changelog lock error

edit

Every now and then you find yourself in a situation where Tomcat gets stuck and there is no other option then to force a shutdown. Then you startup Tomcat, but OpenClinica is not available. In the stdout.log you see as the last line couple of lines

Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
[repeated]

and eventually:

AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@195092c0)
   LogAbandoned: true
   RemoveAbandoned: true
   RemoveAbandonedTimeout: 300
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@1f2be27)
   LogAbandoned: true
   RemoveAbandoned: true
   RemoveAbandonedTimeout: 300
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@bb0620c)
   LogAbandoned: true
   RemoveAbandoned: true
   RemoveAbandonedTimeout: 300

At the same time, in your <server>.<date>.log you will see:

core-db.xml]: Invocation of init method failed; nested exception is liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by UNKNOWN

In this case you must delete all (probably just one) record from the table "databasechangeloglock" (see this thread about 'liquibase has a mechanism to prevent multiple updates'). Shutdown Tomcat first, or stop the OpenClinica app in Tomcat-manager. Start pgadmin and browse to the table; rightclick it View data-View all rows. Select the row(s) and press delete.

Or from the command prompt:

sudo -u postgres /usr/bin/psql
\c openclinica
delete from databasechangeloglock;

Start Tomcat again.