Liquibase update error

I am trying to create multiple tables in a database using Liquibase.

Some reason: I executed the same changelog.xml file in the local h2 database, and it worked succussfully. And I checked the oracle database below, username, password and squirrel driver and successfully connected. Therefore, I am absolutely sure that I am faced with the problem of educational program. I did extensive google-ing and found nothing on SO or anywhere else that could help me.

At the command prompt, I entered the following:

C:\>java -jar liquibase-core-2.0.5.jar --driver=oracle.jdbc.OracleDriver
--classpath=ojdbc6-11.2.0.3.0.jar --changeLogFile=changelog.xml 
--url="jdbc:oracle:thin:@myDatabase"
--username=myUsername --password=myPassword --logLevel=debug update

What came back:

DEBUG 9/30/13 3:09 PM:liquibase: Unable to load/access Apache Derby driver class
to check version
DEBUG 9/30/13 3:09 PM:liquibase: Connected to myUsername@jdbc:oracle:thin:@myDatabase
DEBUG 9/30/13 3:10 PM:liquibase: Executing QUERY database command: SELECT LOCKED
FROM DATABASECHANGELOGLOCK WHERE ID=1 FOR UPDATE
Liquibase Update Failed: Empty result set, expected one row
SEVERE 9/30/13 3:10 PM:liquibase: Empty result set, expected one row
liquibase.exception.LockException: liquibase.exception.DatabaseException: Empty
result set, expected one row
    at liquibase.lockservice.LockService.acquireLock(LockService.java:121)
    at liquibase.lockservice.LockService.waitForLock(LockService.java:61)
    at liquibase.Liquibase.update(Liquibase.java:102)
    at liquibase.integration.commandline.Main.doMigration(Main.java:825)
    at liquibase.integration.commandline.Main.main(Main.java:134)
Caused by: liquibase.exception.DatabaseException: Empty result set, expected one
row
    at liquibase.util.JdbcUtils.requiredSingleResult(JdbcUtils.java:124)
    at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:
159)
    at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:
167)
    at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:
163)
    at liquibase.lockservice.LockService.acquireLock(LockService.java:96)
    ... 4 more
+4
source share
4 answers

DATABASECHANGELOGLOCK , . ( ).

, , :

ID = 1, LOCKED = 0, LOCKGRANTED = null, LOCKEDBY = null

!

+7

Liquibase postgresql 10.4:

Caused by: liquibase.exception.DatabaseException: Expected single row from 
liquibase.statement.core.GetViewDefinitionStatement@1de5f25 but got 0'

, jdbc.

jdbc 9.3-1102-jdbc41 9.4-1202-jdbc41.

+2

,

<dependency>
    <groupId>postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.1-901-1.jdbc4</version>
</dependency>

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.5</version>
</dependency>

for PostgreSQL 10.6. This solved the problem.

0
source

All Articles