Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 90330 invoked from network); 13 Nov 2004 16:29:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 13 Nov 2004 16:29:55 -0000 Received: (qmail 29181 invoked by uid 500); 13 Nov 2004 16:29:54 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 29142 invoked by uid 500); 13 Nov 2004 16:29:54 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 29126 invoked by uid 99); 13 Nov 2004 16:29:54 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jbraeuchi@gmx.ch designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 13 Nov 2004 08:29:51 -0800 Received: (qmail 8037 invoked by uid 65534); 13 Nov 2004 16:29:45 -0000 Received: from adsl-62-167-138-48.adslplus.ch (EHLO [192.168.1.10]) (62.167.138.48) by mail.gmx.net (mp026) with SMTP; 13 Nov 2004 17:29:45 +0100 X-Authenticated: #15507884 Message-ID: <4196364C.8070208@gmx.ch> Date: Sat, 13 Nov 2004 17:29:00 +0100 From: Jakob Braeuchi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7.3) Gecko/20040910 X-Accept-Language: de, en MIME-Version: 1.0 To: OJB Developers List CC: michael@baselinesols.com Subject: Re: Howto: OJB 1.0.0 + Torque 3.1 + HSQLDB 1.7.2 References: <41216330.5080401@baselinesols.com> <419509E6.9010103@gmx.ch> In-Reply-To: <419509E6.9010103@gmx.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hi michael, i updated ojb 1.1 to use torque 3.1.1 (commons-collection 3.1 is supported). i had to update all profiles as well because the properties changed. jakob Jakob Braeuchi schrieb: > hi, > > thanks for your very detailed description. i'm currently trying to > replace the old torque with torque 3.1 (for ojb 1.1) and with the help > of your post it runs quite fine. > > but i do have some questions: > > how can i get rid of these debug infos ? > > [torque-data-sql] [DEBUG] XmlToAppData - endElement(, , column) called > [torque-data-sql] [DEBUG] XmlToAppData - endElement(, , column) called > [torque-data-sql] [DEBUG] XmlToAppData - endElement(, , column) called > [torque-data-sql] [DEBUG] XmlToAppData - endElement(, , column) called > [torque-data-sql] [DEBUG] XmlToAppData - endElement(, , column) called > [torque-data-sql] [DEBUG] XmlToAppData - endElement(, , reference) called > [torque-data-sql] [DEBUG] XmlToAppData - endElement(, , foreign-key) called > [torque-data-sql] [DEBUG] XmlToAppData - endElement(, , table) called > > is it possible to use commons-collections 3.1 with torque 3.1 ? > > tia > jakob > > Michael Hart schrieb: > >> G'day, >> >> I posted this message on the OJB user group - but just in case some >> developers don't frequent there, I figured I'd post it here as well. >> >> Could these small changes be considered for the next release of OJB? >> >> --- snip --- >> >> Torque 3.1 seems to work out of the box with OJB 1.0.0, but not with the >> OJB JUnit tests because Torque 3.1 doesn't like the schema files used >> for these tests. I've created some new schema files that seem to work OK >> (linked to below). >> >> HSQLDB 1.7.2 has problems with Torque because databases created using >> HSQLDB's "In-Process" mode (as the standard DB is in the OJB JUnit >> tests) must now be explicitly closed with a "SHUTDOWN" command for other >> processes to use them. I've contacted the HSQLDB guys about a way to do >> this using SQL, so that it could be included in Torque's template files, >> but for now I've settled on patching the build-torque.xml file to do >> this during the build process, if necessary. >> >> HSQLDB 1.7.2 also has problems with one of OJB's testcases that uses >> hardcoded SQL commands, specifically >> org.apache.ojb.broker.sequence.NativeIdentifierTest as the syntax used >> in this file is not allowed. >> >> So, here are the steps to get Torque 3.1 working with OJB 1.0.0: >> >> - Download OJB 1.0.0 from: >> http://db.apache.org/builds/ojb/1.0.0/db-ojb-1.0.0-src.zip >> and unpack the db-ojb-1.0.0 dir. >> >> - Download torque-gen-3.1 from: >> http://db.apache.org/builds/torque/release/3.1/torque-gen-3.1.zip >> and unpack the torque-gen-3.1 dir. >> >> - Remove old db-ojb-1.0.0/lib/torque-3.0.2.jar >> >> - Copy torque-gen-3.1.jar and village-2.0-dev-20030825.jar from >> torque-gen-3.1/lib/ to db-ojb-1.0.0/lib/ >> >> - Replace db-ojb-1.0.0/build-torque.xml with >> torque-gen-3.1/build-torque.xml >> >> - Copy over >> http://www.alphalink.com.au/~mwhart/ojb/ojbtest-data.dtd and >> http://www.alphalink.com.au/~mwhart/ojb/ojbtest-data.xml >> to db-ojb-1.0.0/src/schema/ >> >> - Grab copies of j2ee.jar and jdo.jar if you don't already have them and >> copy them to db-ojb-1.0.0/lib/ >> >> - Make sure junit.jar is in $ANT_HOME/lib/ and then run "ant junit" from >> the db-ojb-1.0.0 dir >> (ignore the SQL error when trying to create the DB - you can get rid of >> this by removing the "ECHO Not implemented" on the first line of >> sql/db-init/hypersonic/createdb.vm in torque-gen-3.1.jar - and also >> ignore the log4j ERROR messages - you can get rid of these by removing >> the ", org.apache.torque.engine" at the end of line 15 of >> log4j.properties in torque-gen-3.1.jar) >> >> With any luck, all tests will pass! >> >> Now, to get HSQLDB 1.7.2 working with OJB 1.0.0 (assuming previous steps >> have been done): >> >> - Download HSQLDB 1.7.2 from >> http://prdownloads.sourceforge.net/hsqldb/hsqldb_1_7_2_3.zip?download >> and unpack the hsqldb dir. >> >> - Replace db-ojb-1.0.0/lib/hsqldb.jar with new hsqldb/lib/hsqldb.jar >> >> - Replace >> db-ojb-1.0.0/src/test/org/apache/ojb/broker/sequence/NativeIdentifierTest.java >> >> >> with http://www.alphalink.com.au/~mwhart/ojb/NativeIdentifierTest.java >> (diff below) >> >> - If you want to support the new sequences in HSQLDB 1.7.2, replace >> db-ojb-1.0.0/src/java/org/apache/ojb/broker/platforms/PlatformHsqldbImpl.java >> >> >> with http://www.alphalink.com.au/~mwhart/ojb/PlatformHsqldbImpl.java >> (diff below) >> >> - Replace db-ojb-1.0.0/build-torque.xml with >> http://www.alphalink.com.au/~mwhart/ojb/build-torque.xml (diff below) >> >> - Run "ant junit" from the db-ojb-1.0.0 dir >> >> Hopefully, all tests will pass again! >> >> There are probably quite a few more changes introduced in HSQLDB 1.7.2 >> that could be updated in OJB, but sequences was all I was interested in >> and they seem to work fine so far. >> >> Cheers, >> >> Michael >> >> P.S. >> >> Here are the diffs for those interested (sorry if it wraps): >> >> diff for NativeIdentifierTest.java: >> >> 48c48 >> < " REF_ID int(11),NAME VARCHAR(250))"; >> --- >> >>> " REF_ID INT, NAME VARCHAR(250))"; >> >> >> 58c58 >> < " NAME VARCHAR(250), FK_ID BIGINT, REF_ID int(11), >> SINGLE_REF_FK BIGINT)"; >> --- >> >>> " NAME VARCHAR(250), FK_ID BIGINT, REF_ID INT, >>> SINGLE_REF_FK BIGINT)"; >> >> >> >> >> diff for PlatformHsqldbImpl.java: >> >> 67a68,81 >> >>> public String createSequenceQuery(String sequenceName) >>> { >>> return "CREATE SEQUENCE " + sequenceName; >>> } >>> >>> public String nextSequenceQuery(String sequenceName) >>> { >>> return "CALL NEXT VALUE FOR " + sequenceName; >>> } >>> >>> public String dropSequenceQuery(String sequenceName) >>> { >>> return "DROP SEQUENCE " + sequenceName; >>> } >> >> >> >> >> >> diff for build-torque.xml (based on the file found in torque-gen-3.1, >> not OJB): >> >> 249a250,318 >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >>> >>> >>> >>> >>> >>> >>> >> substring="jdbc:hsqldb:hsql://" /> >>> >> substring="jdbc:hsqldb:hsqls://" /> >>> >> substring="jdbc:hsqldb:http://" /> >>> >> substring="jdbc:hsqldb:https://" /> >>> >>> >>> >>> >>> >>> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >>> >> depends="shutdown-check" >>> if="torque.internal.shutdownAfterSql"> >>> >>> ; >>> SHUTDOWN; >>> >>> >>> >>> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >>> >> depends="shutdown-check" >>> if="torque.internal.shutdownAfterSql"> >>> >>> >> message="SHUTDOWN;" /> >>> >>> >> message="shutdown.sql=${torque.project}" /> >>> >>> >>> >>> >> 280a350,357 >> >>> >>> >>> >> value="${torque.database.createUrl}" /> >>> >> value="${torque.sql.dir}/create-db.sql" /> >>> >>> >> 294a372 >> >>> >> 304a383,388 >> >>> >>> >>> >> value="${torque.database.buildUrl}" /> >>> >>> >> 315a400 >> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org >> For additional commands, e-mail: ojb-user-help@db.apache.org >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org >> For additional commands, e-mail: ojb-dev-help@db.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-dev-help@db.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org