Return-Path: Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 46878 invoked from network); 14 Apr 2003 18:11:55 -0000 Received: from dsl081-120-228.dfw1.dsl.speakeasy.net (HELO mail.Transmorphix.com) (64.81.120.228) by daedalus.apache.org with SMTP; 14 Apr 2003 18:11:55 -0000 Received: (qmail 3111 invoked by uid 506); 14 Apr 2003 18:11:59 -0000 Received: from unknown (HELO ripper) (192.168.10.105) by 0 with SMTP; 14 Apr 2003 18:11:59 -0000 From: "Brian K. Wallace" To: "Turbine Torque Users List" Date: Mon, 14 Apr 2003 13:11:59 -0500 MIME-Version: 1.0 Subject: Re: AW: AW: NullpointerException Message-ID: <3E9AB39F.13850.3629982@localhost> Priority: normal In-reply-to: <000501c302b1$94b59160$2c01a8c0@STARDUST> References: <3E9AABFD.15811.344CEFF@localhost> X-mailer: Pegasus Mail for Windows (v4.02) Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: Quoted-printable Content-description: Mail message body X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N If you want to get technical.... there is a way to avoid this message - - = go with a DB that has basic support for transactions from db through driver into Torque= . ;-) [no, I'm not going the "But MySQL does have transaction support" route - just sayin= ']. Otherwise, take the warning for what it's worth to you, or try to play log= ging games around the Torque.init (set the level to ERROR, init, then back to WARN). = I've seen this warning so much I'd think it was broken if it wasn't there. :-) Glad to see you're up and running, tho'. On 14 Apr 2003 at 20:13, Ronny Walter wrote: > Thank you, now it works. :-) I selected my first objects with torque. > > Now i get a warning: > 591 [main] WARN oid.IDBroker - IDBroker is being used with db > 'default', which does not support transactions. IDBroker attempts to use > transactions to limit the possibility of duplicate key generation. > Without transactions, duplicate key generation is possible if multiple > JVMs are used or other means are used to write to the database. > > I am sure, that there is a possibility to avoid this message :-) > > Ronny > > > -----Urspr=FCngliche Nachricht----- > Von: Brian K. Wallace [mailto:brian@transmorphix.com] > Gesendet: Montag, 14. April 2003 19:39 > An: Turbine Torque Users List > Betreff: Re: AW: NullpointerException > > > I'm currently using Torque to talk to quite a few databases including > MySQL. I > responded with the initial problem that I had and how I fixed it, but in > looking closer at > your properties, you're also missing the factory property. Below is a > snippet from my > config that encompasses all connection information for a single db - > where I have > 'appdb', yours is listed as 'default': > > torque.database.default=3Dappdb torque.database.appdb.adapter=3Dmysql > torque.dsfactory.appdb.factory=3Dorg.apache.torque.dsfactory.TorqueDataS= ou > rceFact > ory > torque.dsfactory.appdb.pool.defaultMaxConnections=3D15 > torque.dsfactory.appdb.pool.maxExpiryTime=3D1200 > torque.dsfactory.appdb.pool.connectionWaitTimeout=3D10 > torque.dsfactory.appdb.connection.driver =3D org.gjt.mm.mysql.Driver > torque.dsfactory.appdb.connection.url =3D > jdbc:mysql://localhost:3306/apdb0001 > torque.dsfactory.appdb.connection.user =3D username > torque.dsfactory.appdb.connection.password =3D password > > torque.idbroker.cleverquantity =3D true > torque.manager.useCache =3D true > > I didn't find much on the internet that addresses this, but I hope this > helps. > > On 14 Apr 2003 at 19:34, Ronny Walter wrote: > > > It's still doesn't work :-( > > > > Is there an example with a mysql-database in the internet? > > > > > > Ronny > > > > > > -----Urspr=FCngliche Nachricht----- > > Von: Brian K. Wallace [mailto:brian@transmorphix.com] > > Gesendet: Montag, 14. April 2003 17:43 > > An: Turbine Torque Users List > > Betreff: Re: NullpointerException > > > > > > Try adding the line > > > > torque.database.default=3Ddefault > > > > to your property file. > > > > > > On 14 Apr 2003 at 17:29, Ronny Walter wrote: > > > > > Hello, > > > > > > I've tested the generation of the XML-Schema. Then i created the > > > Objects and wrote a little testclass: > > > > > > public class ScheduleReader { > > > public static void main(String[] args) throws Exception { > > > Torque.init("Torque.properties"); > > > Schedule sch =3D null; > > > Criteria crit =3D new Criteria(); > > > crit.add(SchedulePeer.HOMETEAM, "Chicago%"); > > > List l =3D SchedulePeer.doSelect(crit); > > > Iterator it =3D l.iterator(); > > > while (it.hasNext()) { > > > System.out.println(((Schedule) > > > it.next()).getTitle()); > > > } > > > } > > > } > > > > > > The propertiy file: > > > torque.database.default.adapter=3Dmysql > > > torque.dsfactory.default.pool.defaultMaxConnections=3D10 > > > torque.dsfactory.default.pool.maxExpiryTime=3D3600 > > > torque.dsfactory.default.pool.connectionWaitTimeout=3D10 > > > ### MySQL > > > torque.dsfactory.default.connection.driver =3D org.gjt.mm.mysql.Driv= er > > > torque.dsfactory.default.connection.url =3D > > > jdbc:mysql://localhost:3306/centerice > > > torque.dsfactory.default.connection.user =3D atlan > > > torque.dsfactory.default.connection.password =3D > > > log4j.category.org.apache.torque =3D INFO, torque > log4j.appender.torque > > > =3D org.apache.log4j.FileAppender log4j.appender.torque.file =3D > > > ./centerice.log log4j.appender.torque.layout =3D > > > org.apache.log4j.PatternLayout > > > log4j.appender.torque.layout.conversionPattern =3D %d [%t] %-5p %c -= > > > %m%n log4j.appender.torque.append =3D false > > > > > > After starting the Programm, the following error occurs: > > > > > > java.lang.NullPointerException: Connection object was null. This > > > could > > > > > be due to a misconfiguration of the DataSourceFactory. Check the > > > logs > > > and Torque.properties to better determine the cause. > > > at > > > org.apache.torque.util.Transaction.rollback(Transaction.java:179) > > > at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1333) > > > at > > > > de.centerice.om.BaseSchedulePeer.doSelectVillageRecords(BaseSchedulePe > > > er > > > .java:414) > > > at > > > > > de.centerice.om.BaseSchedulePeer.doSelectVillageRecords(BaseSchedulePe > > er > > > .java:382) > > > at > > > de.centerice.om.BaseSchedulePeer.doSelect(BaseSchedulePeer.java:350) > > > at > > > de.centerice.tests.ScheduleReader.main(ScheduleReader.java:27) > > > Exception in thread "main" > > > > > > > > > The logfile says: > > > 2003-04-14 17:21:42,385 [main] INFO org.apache.torque.Torque - > > > Logging has been configured by Torque. 2003-04-14 17:21:42,525 > [main] > > > WARN org.apache.torque.oid.IDBroker - IDBroker is being used with > db > > > 'default', which does not support transactions. IDBroker attempts to > > > > use transactions to limit the possibility of duplicate key > generation. > > > > > Without transactions, duplicate key generation is possible if > > > multiple > > > > > JVMs are used or other means are used to write to the database. > > > > > > > > > > > > Whats wrong? > > > Thank you for some hints :-) > > > > > > Ronny > > > > > > > > > > > > -------------------------------------------------------------------- > > > - > > > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > > For additional commands, e-mail: torque-user-help@db.apache.org > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > For additional commands, e-mail: torque-user-help@db.apache.org > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > For additional commands, e-mail: torque-user-help@db.apache.org > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > >