[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 03:11:08 CDT 2006


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

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

> I think there's not much chance we'll add it to the 1.5 branch[...]limited resources

Same problem here but the other way around: I can only afford to invest my time into one version of Daisy and that has to be a stable version (we're going productive this or next week) :-)

Therefore, I suggest you still look through the patches. Many of them will still apply unmodified to trunk. If you apply them, just backport them to 1.5.

I understand there will be friction between us because of this but I think it will not be a big issue (time wise).

> Using torque scripts from src/generator/src/templates/

There is no such directory in the torque 3.2 downloads. I checked torque-3.2-src.zip and torque-gen-3.2-src.zip.

In 3.1.1, the files exist.

Can you please confirm that 3.1.1 is the correct version of torque to use? I found this version in the maven cache but I'm not sure that's the version which you copied into the sources.

> Maybe this will also solve your problem with booleans and the too-long constraint names.

My patch fixed three issues:

1. Unicode needs columns twice as wide. This is not fixed by the torque templates in 3.1.1.

2. The booleans don't work either because the template files simply don't add anything to boolean mapping; this must happen somewhere in the Java part of torque.

3. And the fix for the too-long constraint names will not help because you don't use torque to *access* the data. So while the new torque templates will cut off the table names, your hand-written SQL will fail simply because the tables don't exist.

When you confirm the correct torque version, I'll base my patches on the templates found there but we'll still have to include my additional patches.

> 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