Note that there are some explanatory texts on larger screens.

plurals
  1. POLiquibase - Error on SYSTEM.DATABASECHANGELOGLOCK while re-executing a migration
    primarykey
    data
    text
    <p>I'm using Liquibase 3.0.2, Ant task updateDatabase and change sets defined directly inside SQL scripts using comments like</p> <pre><code>--liquibase formatted sql --changeset com.noemalife:1 dbms:oracle </code></pre> <p>etc.</p> <p>The first run works fine, all change sets are executed and DB objects (oracle) are deployed. I can see DATABASECHANGELOG and DATABASECHANGELOGLOCK tables filled up.</p> <p>Then I try to re-run the Ant task with the same exact configuration, expecting Liquibase to say something like "Ok, all is already deployed, nothig to do here."</p> <p>But I get this instead:</p> <pre><code>C:\Users\dmusiani\Desktop\liquibase-test&gt;ant migrate Buildfile: build.xml migrate: [copy] Copying 1 file to C:\Users\dmusiani\Desktop\liquibase-test BUILD FAILED liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE SYSTEM.DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIM ESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)); on jdbc:oracl e:thin:@localhost:1521:WBMDINSERT INTO SYSTEM.DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0): ORA- 00955: nome giÓ utilizzato da un oggetto esistente at liquibase.lockservice.LockServiceImpl.acquireLock(LockServiceImpl.java:122) at liquibase.lockservice.LockServiceImpl.waitForLock(LockServiceImpl.java:62) at liquibase.Liquibase.update(Liquibase.java:123) at liquibase.integration.ant.DatabaseUpdateTask.executeWithLiquibaseClassloader(DatabaseUpda teTask.java:45) at liquibase.integration.ant.BaseLiquibaseTask.execute(BaseLiquibaseTask.java:70) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) at org.apache.tools.ant.Main.runBuild(Main.java:758) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Caused by: liquibase.exception.DatabaseException: Error executing SQL CREATE TABLE SYSTEM.DATABASECH ANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR 2(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)); on jdbc:oracle:thin:@localhost:1521:W BMDINSERT INTO SYSTEM.DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, 0): ORA-00955: nome giÓ utilizza to da un oggetto esistente at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:56) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:98) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:64) at liquibase.database.AbstractJdbcDatabase.checkDatabaseChangeLogLockTable(AbstractJdbcDatab ase.java:771) at liquibase.lockservice.LockServiceImpl.acquireLock(LockServiceImpl.java:95) ... 21 more Caused by: java.sql.SQLException: ORA-00955: nome giÓ utilizzato da un oggetto esistente at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:754) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:963) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1192) at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1731) at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1701) at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor. java:86) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:49) ... 25 more Total time: 1 second C:\Users\dmusiani\Desktop\liquibase-test&gt; </code></pre> <p>It seems to me that Liquibase is trying to re-create the DATABASECHANGELOGLOCK table.</p> <p>I have this problem when I run Liquibase with the Oracle "system" user (my patch cares about creating a couple of other users, thus for testing purposes I use system directly to do that). The other strange thing is that after the system's patch run succesfully, in the lock table I can still see the lock is active. When I run other patches in other schemas(ex. the ones created by the system's patch), I have the patch completing successfully and the lock released in the lock table; relaunching that patch behaves as expected: Liquibase detects the patch is already in place ad does nothing.</p> <p>This said, now my doubt is if Liquibase has problems, in the system schema, in detecting the lock table is already existing (and fails trying to deploy it) or if there is some kind of locking/commit problem.</p> <p>Any suggestion is welcome</p> <p>Thanks</p> <p>Davide</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload