problem with sql tag on unsupported database

Hi,

I am trying to integrate liquibase in our project, it works fine with MySQL. But for our project, it is forseen of DB type change in the future and one possibility is to use data warehouse instead of MySQL, which is not supported by liquibase yet.

I have tried to communicate with data warehouse (named Vertica) via JDBC commands, works fine. So I tried to use sql tag in liquibase change log to communicate with the DB, but failed with the following exceptions:

 DEBUG 1/24/12 4:30 PM:liquibase: Unable to load/access Apache Derby driver class org.apache.derby.tools.sysinfo to check version: org.apache.derby.tools.sysinfo

WARNING 1/24/12 4:30 PM:liquibase: Unknown database: Vertica DatabaseLiquibase Update Failed: Unknown Reason
SEVERE 1/24/12 4:30 PM:liquibase: Unknown Reason
java.lang.NullPointerException
        at liquibase.database.AbstractDatabase.rollback(AbstractDatabase.java:981)
        at liquibase.integration.commandline.Main.doMigration(Main.java:835)
        at liquibase.integration.commandline.Main.main(Main.java:133)


I have already set the log level to DEBUG, but still didn’t get much info of the exception. Do you have some suggestion of what can I do to make it working? Thanks!

Hi Nathan,

Thanks for your reply.

Yes, I am using 2.0.2, and there’s no other errors besides the one I have put.

I think I will try to create my own Database instance then, if not as expected I will create my own DB class.

By the way, I have tried several times, the link liquibase.org/extensions seems not available. Do you know, approximatly when can the web be back?


Assuming you are running 2.0.2, the line corresponds to having a null connection in the code that tries to do a rollback to clean up after normal processing. There may be an error earlier that is being masked by the rollback failure, but I would think that should show as well. Are there any other errors?

You can create your own Database instance that supports Vertica using the extension system (liquibase.org/extensions) to handle any issues you run into. Creating a VerticaDatabase class may solve this as well too.


Nathan

Hi Nathan,

I was able to access to the liquibase.org/extensions and had tried to create VerticaDatabase class follow the instructions given at http://liquibase.jira.com/wiki/display/CONTRIB/Database and also check the code for Teradata database.

The new class file is added under liquibase.database.ext of the liquibase.jar, but still getting the same error message.

The problem is, with the error message, it is impossible to know what caused the error. Do you have more suggestions? Thanks!

BTW, I was wrong about the versioning earlier. It is 2.0.3 instead of 2.0.2.


Are you still getting the same “unknown database” error? It could be the extension isn’t being picked up still.


Are you running the command line app actually from the command line, or running the Main class programatically from within your code?

Nathan

Hi Nathan,

I am currently trying to manage a Ingres-DB with liquibase and I run into the same problem. Seeing that there is an interrupt in communication in this thread, I just picking it :-).

I implemented a minimalistic class liquibase.database.ext.IngresDatabase and put it on the classpath:

Running "java -jar liquibase.jar --classpath=./bin:iijdbc_92.jar --driver=com.ingres.jdbc.IngresDriver --url=“jdbc:ingres://myconnection” --username=myuser --password=mypassword --changeLogFile=first.xml --logLevel=debug update"


  1. java -jar liquibase.jar --classpath=./bin:./iijdbc_92.jar --driver=com.ingres.jdbc.IngresDriver --url=“jdbc:ingres://myconnection” --username=myuser --password=mypassword --changeLogFile=first.xml --logLevel=debug update
  2. DEBUG 2/23/12 12:20 PM:liquibase: Unable to load/access Apache Derby driver class org.apache.derby.tools.sysinfo to check version: org.apache.derby.tools.sysinfo
    WARNING 2/23/12 12:20 PM:liquibase: Unknown database: INGRES
    Liquibase Update Failed: Unknown Reason
    SEVERE 2/23/12 12:20 PM:liquibase: Unknown Reason
    java.lang.NullPointerException
        at liquibase.database.AbstractDatabase.rollback(AbstractDatabase.java:981)
        at liquibase.integration.commandline.Main.doMigration(Main.java:835)
        at liquibase.integration.commandline.Main.main(Main.java:133)
Why is derby involved at all? - I don’t see a reference.

It seems that the class (located in bin/liquibase/database/ext) is not loaded. At least, I get the same error message when I execute the same without ./bin on the classpath.

Regards,
Simon

Thanks! I applied the change locally and will get it pushed along with a bunch of other changes I have locally.


Nathan

After checking out the source I found the problem for NullpointerException:

 The connection is not passed to the database object in the DatabaseFactory in case of unsupported databases. This will always result in a NullPointerException. Attached the modified source.

… here it comes.

- Simon

Hi All, 


  Does anyone have the code for a Vertica database extension? If possible, can you share it?


Thanks,

Alexis

I haven’t heard of any vertica extensions so far.


Nathan

Yes… it worked but as an unknown database. We are going to use just and tags.

Hi guys. I am also considering usage of liquibase with Vertica DB. Alex, did above attached DatabaseFactory.java solve your issue?