From mailinglists@freenet.de Mon Apr 14 18:07:44 2003 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 41165 invoked from network); 14 Apr 2003 18:07:44 -0000 Received: from mout2.freenet.de (194.97.50.155) by daedalus.apache.org with SMTP; 14 Apr 2003 18:07:44 -0000 Received: from [194.97.50.138] (helo=mx0.freenet.de) by mout2.freenet.de with asmtp (Exim 4.14) id 1958Mu-0004Bi-E4 for torque-user@db.apache.org; Mon, 14 Apr 2003 20:07:48 +0200 Received: from port-212-202-149-18.reverse.qsc.de ([212.202.149.18] helo=STARDUST) by mx0.freenet.de with asmtp (ID mailinglists@freenet.de) (Exim 4.14 #2) id 1958Mt-0005Ug-Vp for torque-user@db.apache.org; Mon, 14 Apr 2003 20:07:48 +0200 From: "Ronny Walter" To: "'Turbine Torque Users List'" Subject: AW: AW: NullpointerException Date: Mon, 14 Apr 2003 20:13:40 +0200 Message-ID: <000501c302b1$94b59160$2c01a8c0@STARDUST> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <3E9AABFD.15811.344CEFF@localhost> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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]=20 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=20 responded with the initial problem that I had and how I fixed it, but in looking closer at=20 your properties, you're also missing the factory property. Below is a snippet from my=20 config that encompasses all connection information for a single db - where I have=20 'appdb', yours is listed as 'default': torque.database.default=3Dappdb torque.database.appdb.adapter=3Dmysql torque.dsfactory.appdb.factory=3Dorg.apache.torque.dsfactory.TorqueDataSo= u 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 :-( >=20 > Is there an example with a mysql-database in the internet? >=20 >=20 > Ronny >=20 >=20 > -----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 >=20 >=20 > Try adding the line >=20 > torque.database.default=3Ddefault >=20 > to your property file. >=20 >=20 > On 14 Apr 2003 at 17:29, Ronny Walter wrote: >=20 > > Hello, > >=20 > > I've tested the generation of the XML-Schema. Then i created the > > Objects and wrote a little testclass: > >=20 > > 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()); > > } > > } > > } > >=20 > > 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.Driver > > torque.dsfactory.default.connection.url =3D=20 > > jdbc:mysql://localhost:3306/centerice > > torque.dsfactory.default.connection.user =3D atlan=20 > > torque.dsfactory.default.connection.password =3D=20 > > log4j.category.org.apache.torque =3D INFO, torque log4j.appender.torque=20 > > =3D org.apache.log4j.FileAppender log4j.appender.torque.file =3D=20 > > ./centerice.log log4j.appender.torque.layout =3D=20 > > org.apache.log4j.PatternLayout=20 > > log4j.appender.torque.layout.conversionPattern =3D %d [%t] %-5p %c - = > > %m%n log4j.appender.torque.append =3D false > >=20 > > After starting the Programm, the following error occurs: > >=20 > > java.lang.NullPointerException: Connection object was null. This=20 > > could >=20 > > be due to a misconfiguration of the DataSourceFactory. Check the=20 > > 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=20 > > 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" > >=20 > >=20 > > 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]=20 > > WARN org.apache.torque.oid.IDBroker - IDBroker is being used with db=20 > > 'default', which does not support transactions. IDBroker attempts to > > use transactions to limit the possibility of duplicate key generation. >=20 > > Without transactions, duplicate key generation is possible if=20 > > multiple >=20 > > JVMs are used or other means are used to write to the database. > >=20 > >=20 > >=20 > > Whats wrong? > > Thank you for some hints :-) > >=20 > > Ronny > > =20 > >=20 > >=20 > > -------------------------------------------------------------------- > > - > > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > For additional commands, e-mail: torque-user-help@db.apache.org > >=20 > >=20 >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org