Return-Path: Mailing-List: contact turbine-torque-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list turbine-torque-user@jakarta.apache.org Received: (qmail 4739 invoked by uid 98); 23 Dec 2002 14:52:53 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 4719 invoked from network); 23 Dec 2002 14:52:52 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 23 Dec 2002 14:52:52 -0000 Received: (qmail 76915 invoked by uid 500); 23 Dec 2002 14:51:39 -0000 Received: (qmail 76908 invoked from network); 23 Dec 2002 14:51:38 -0000 Received: from relais.videotron.ca (HELO VL-MS-MR001.sc1.videotron.ca) (24.201.245.36) by daedalus.apache.org with SMTP; 23 Dec 2002 14:51:38 -0000 Received: from videotron.ca ([66.131.32.226]) by VL-MS-MR001.sc1.videotron.ca (iPlanet Messaging Server 5.2 HotFix 0.9 (built Jul 29 2002)) with ESMTP id <0H7K004OEUJHMX@VL-MS-MR001.sc1.videotron.ca> for turbine-torque-user@jakarta.apache.org; Mon, 23 Dec 2002 09:50:05 -0500 (EST) Date: Mon, 23 Dec 2002 09:45:05 -0500 From: Jean-Marc Lavoie Subject: Re: I hate IdGenerator To: Turbine Torque Users List Message-id: <3E072171.5090903@videotron.ca> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 References: <4C47F66C98B28B4F903120350DEF05B0268D7F@hqexch01.upstate.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N If I understand you want to use autoincrement from the database. Try the following tags : For the schema itself: defaultIdMethod="none" For the Table : idMethod="native" For the primary Key Column : type="INTEGER" primaryKey="true" autoIncrement="true" required="true" Using defaultIdMethod="native" on the schema, and nothing on the table works greats if you only have autoincrmenet tables. EPugh@upstate.com wrote: >Not sure why you are getting those errors(but I think native is bad or >something), here is my config: > > >defaultIdMethod="native" baseClass="BaseObject" basePeer="BasePeer" >defaultJavaType="object"> > > > required="true" type="INTEGER" /> > > type="VARCHAR" /> > type="VARCHAR" /> > type="VARCHAR" /> > type="VARCHAR" /> > type="DATE"/> > type="VARCHAR" /> > >
> >Eric Pugh > >-----Original Message----- >From: Tuncay Baskan (Internet Grubu) >[mailto:Tuncay.Baskan@intertech.com.tr] >Sent: Saturday, December 21, 2002 10:52 AM >To: Turbine-Torque-User (E-mail) >Subject: I hate IdGenerator > > >Torque works without a problem when used from a non-webapplication. I'm able >to save() my objects which have autoIncrement primary keys. > >But when using Torque in a web application I'm getting > "IdGenerator for table xxx is null" >for every table which has an autoincrement primary key. > >For example; in a struts action I have the following: > Department dept = new Department(); > dept.setName("test"); > dept.save(); >and in a command line application written for testing I have exactly the >same code but it is working without a problem. > >I think there is only one difference between them. The command line >version initiates its own connection pooling and gets the connection >from that pool. The web application which uses Tomcat as server >initiates Torque from a servlet with Tomcat's JNDI resource mechanism. > >Is this a configuration problem? If so how can I correct the problem. > >Btw here is the relevant portions of my schema: > > > "http://jakarta.apache.org/turbine/dtd/database.dtd">name="eproject" defaultIdMethod="native"> > > > type="INTEGER"/> > >
> > >/tb. >