Hi,

ok, replying to myself after some hours of investigation:

1) we need to define a new DB dialiect in Liquibase which is called  
"DB2 for iSeries". The DB2 on this platform, while mostly SQL level  
compliant has some quirks when it comes to MetaData handling. Its a  
different driver also which is used on this platform. I could start  
cloning the original DB2 and make some changes. With current version,  
Liquibase handles it like a normal DB2 DB because the proprietary  
product name (defined in driver) starts also with DB2 (DB2 UDB for  
iSeries).

2) my problem mentioned is there because of the call in  
AbstractDatabase.doesChangeLogLockTableExist()

rs =  
connection 
.getMetaData 
().getTables(convertRequestedSchemaToCatalog(getDefaultSchemaName()),  
convertRequestedSchemaToSchema(getDefaultSchemaName()),  
getDatabaseChangeLogLockTableName(), new String[]{"TABLE"});

just doesnt work. On DB2 for ISeries its a bad idea to supply "null"  
as schema name. It uses some user profile defaults to determine the  
default schema instead of just looking at some very prominent JDBC url  
parameters for the jt400 driver.

The mother of all my problems is, that every call to getTables() just  
doesnt work or better, results in a result-set without any rows. So  
Liquibase thinks there are no tables. In my case he thinks that its  
DBCHANGELOG tables are not there, but they are.

So as long as DB2 for iSeries is different in some ways (and to my  
knowledge, this will be the case for the time being), you have to  
handle it differently. This also applies for nearly ALL SQL clients  
available. I am using DBVisualizer which is really good but it also  
fails with some DB2 for iSeries thingies because of the non-existant  
DB2 abstraction for this platform.

So i am willing to help out there and hope patches are appreciated.

---
regards
Marc Logemann
http://www.logemann.org
http://www.logentis.de




Am 30.05.2009 um 00:41 schrieb Marc Logemann:

> Hi,
>
> i am trying to use liquibase to bootstrap a complete DB schema, thus i
> dont have any tables. Only the schema. Normally Liquibase creates its
> two management tables and then runs the changeset. This works with
> MySQL but with DB2 for iSeries, i am getting the following stack. It
> seems Liquibase use a Constraint names two times. Lquibase wants to
> create "PK_DATABASECHANGE" two times.
>
> java.sql.SQLException: [SQL0601] PK_DATABASECHANGE der Art * in
> NETVERSYS2 bereits vorhanden.
>      at
> com.ibm.as400.access.JDError.throwSQLException(JDError.java:650)
>      at
> com.ibm.as400.access.JDError.throwSQLException(JDError.java:621)
>      at
> com
> .ibm
> .as400 
> .access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:
> 1378)
>      at
> com
> .ibm.as400.access.AS400JDBCStatement.execute(AS400JDBCStatement.java:
> 1729)
>      at
> org
> .apache
> .commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java: 
> 264)
>      at liquibase.database.template.JdbcTemplate
> $1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78)
>      at
> liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48)
>      at
> liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86)
>      at
> liquibase
> .database
> .AbstractDatabase
> .checkDatabaseChangeLogLockTable(AbstractDatabase.java:712)
>      at liquibase.lock.LockHandler.acquireLock(LockHandler.java:40)
>      at liquibase.lock.LockHandler.waitForLock(LockHandler.java:150)
>      at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:518)
>
> The SQL message is in german, it translates to:
>
> java.sql.SQLException: [SQL0601] PK_DATABASECHANGE of Type * in
> NETVERSYS2 already existant.
>
> And in fact it already exists because Liquibase already created its
> first (the lock table) entity. It seems it wants to create the second
> with the same constraint name. Can this be?
>
> ---
> regards
> Marc Logemann
> http://www.logemann.org
> http://www.logentis.de
>
>
>
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity  
> professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp as they present alongside digital heavyweights like  
> Barbarian
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
> _______________________________________________
> Liquibase-user mailing list
> Liquibase-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/liquibase-user


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Liquibase-user mailing list
Liquibase-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Reply via email to