[daisy] [JIRA] Commented: (DSY-350) Patches to make Daisy 1.5 run with IBM DB2

Aaron Digulla (JIRA) issues at cocoondev.org
Mon Sep 18 07:31:08 CDT 2006


    [ http://issues.cocoondev.org//browse/DSY-350?page=comments#action_12924 ] 

Aaron Digulla commented on DSY-350:
-----------------------------------

Ok, I feel this becomes more than one bug :-) I'll split them.

> I thought it were the constraint names which were too long, not the table names?

That's correct. The DB2 templates (which seem a bit old) contain:

maxColumnNameLength = 18

but that has no effect (length of column names was never an issue). The templates also contain PK statements without names, so the only names left are those for indexes. This makes the patch a bit smaller but I still need to search&replace the index names.

But I'd like to put this bug back for now and fix the other two (illegal quotes in SQL and setObject(n, null)). Those fixes will make this patch much more simple.

> Patches to make Daisy 1.5 run with IBM DB2
> ------------------------------------------
>
>          Key: DSY-350
>          URL: http://issues.cocoondev.org//browse/DSY-350
>      Project: Daisy
>         Type: Improvement
>   Components: Database support
>     Versions: public - 1.5
>     Reporter: Aaron Digulla
>     Priority: Minor
>  Attachments: daisy-patch.txt, daisy-patch.txt
>
> *NOTE* This patch is *not* ready to be included. Please read the comments below and give me feedback so I can fix everything.
> - The patch is against Daisy 1.5. I can't really create a patch against 2.0 because we're using 1.5 in production and that's my topmost priority. If have a good solution, I'm game.
> - Removed illegal quotes in many SQL statements
> - Fixed setObject(N, null) in LocalDocumentStrategy.storeFields() which DB2 doesn't like (and Oracle, too)
> - Fixed a couple of unused imports
> - LocalCollectionStrategy: backported a fix from trunk (invoking the event COLLECTION_DELETED). Not sure about this one.
> - LocalEmailSubscriptionManager contains "select null from" which doesn't work with DB2 (and probably Oracle). Use "select 1 from" instead.
> - install/maven.xml: Build SQL for DB2 and invoke an additional task to shorten constraint names which are too long for DB2 (max. 18 chars)
> - install/src/torque/sql/base/db2/columns.vm: Unicode strings are stored as UTF-8 bytes in VARCHAR, so each VARCHAR must be twice as long in DB2
> There is also an attempt to make BOOLEANCHAR with DB2 which doesn't work. No idea why I get "CHAR" for columns which are defined as BOOLEANCHAR in daisy-schema.xml in this file.
> - Most of the other torque/velocity files are copied from the Oracle files. The types in install/src/torque/sql/base/db2/db.props are adjusted according to the DB2 documentation. They say that the JDBC driver maps "boolean" to SMALLINT (except in PreparedStatement.setObject() ...)
> - install/src/schema/daisy-schema.xml: This is a big one. Replaced all DATE by TIMESTAMP (because these fields like last_modified contain more than just the day)
> I also had to replace BOOLEANCHAR by BIT to allow to map it to SMALLINT as DB2 JDBC required.
> - install/DB2DatabaseSpecifics.java: In getPreStatements(), I create a new stored procedure which I need to drop tables without errors. It would be better if the DB connection was passed into this method so I could do the error handling myself.
> As it is now, the method will fail unless you create the method manually before you run the installation for the first time.
> (There might be a way to drop the procedure safely but I couldn't find it)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the daisy mailing list