Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 52798 invoked from network); 2 Oct 2003 19:20:54 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 2 Oct 2003 19:20:54 -0000 Received: (qmail 35989 invoked by uid 500); 2 Oct 2003 19:20:41 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 35983 invoked by uid 500); 2 Oct 2003 19:20:41 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 35970 invoked from network); 2 Oct 2003 19:20:40 -0000 Received: from unknown (HELO mail.sega.com) (64.95.120.84) by daedalus.apache.org with SMTP; 2 Oct 2003 19:20:40 -0000 Received: from sega.com (dhcp-10-10-10-30.sega.com [10.10.10.30]) by mail.sega.com (Mirapoint Messaging Server MOS 3.3.6-GR) with ESMTP id AHE86731; Thu, 2 Oct 2003 12:20:45 -0700 (PDT) Message-ID: <3F7C79CC.3060007@sega.com> Date: Thu, 02 Oct 2003 12:17:32 -0700 From: Robert Dietrick Reply-To: robd@sega.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021126 X-Accept-Language: en-us, en, pt-br MIME-Version: 1.0 To: Apache Torque Users List Subject: Re: Oracle sequences for id generation References: <023D67509140484DBEFD73AF8D8A42B0303A11@oraexch1.ora.experian.com> <3F7C6A95.7060507@sega.com> In-Reply-To: <3F7C6A95.7060507@sega.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Problem solved. Of course, it was a configuration issue. I hadn't *really* set the adapter property to "oracle" in the Torque.properties file. thanks for your suggestions. Robert Dietrick wrote: > Robles, Rogelio wrote: > >> here a quick sniff test to your problem: >> >> after your schema.xml it's complete, did you regenerate your Object Model >> classes? > > > Yes. > >> did you recompile and deploy them? replacing your old ones? > > > Yes. > >> usually in the *MapBuilder.java files is wher your primary key method >> it's >> stored; > > > here's a snippet from my map builder class: > > TableMap tMap = dbMap.getTable("users"); > tMap.setPrimaryKeyMethod(TableMap.NATIVE); > tMap.setPrimaryKeyMethodInfo("users_SEQ"); > tMap.addPrimaryKey("users.USER_ID", new Long(0)); > > And even after all this, I still get the same error: > org.apache.torque.TorqueException: IdGenerator for table 'users' is null > > >> did you add the property autoIncrement="true" to the primary key >> columns? so >> the the proper SQL will be generated for native keys? > > > I thought autoIncrement was just for MySQL? I tried this anyway, with > no effect. > > Still Stumped. > > -rob > >>> -----Original Message----- >>> From: Robert Dietrick [mailto:rdietrick@sega.com] >>> Sent: Wednesday, October 01, 2003 6:15 PM >>> To: torque-user@db.apache.org; torque-dev@db.apache.org >>> Subject: Oracle sequences for id generation >>> >>> >>> I am trying to increase performance by switching from id brokers to >>> Oracle sequences. I've changed my schema file to use the native id >>> method alla: >>> >> name="segadb01" >>> defaultIdMethod="native" >>> >>> Yet, at runtime, when I attempt to store a new record, I get this error: >>> org.apache.torque.TorqueException: IdGenerator for table 'users' is null >>> >>> After looking through my generated classes and the Torque source >>> code, I'm convinced that the addIdGenerator() method of the >>> org.apache.torque.map.DatabaseMap class is never being called with >>> the native IDMethod as an argument. Thus, when BasePeer tries to get >>> the IdGenerator for my class, it gets a null instead, since only >>> IDBroker's are available for ID generation (I've confirmed this by >>> adding some debugging lines to the Torque source). >>> >>> My question is: What instructs Torque to initialize the idGenerators >>> collection in the DatabaseMap class (via addIdGenerator())? Is this >>> something dynamic, based on which adapter you're using? Should >>> something in the schema file be determining this? Do I need to do it >>> manually? Is it a bug? >>> >>> I'm using Torque 3.0. Any help would be appreciated. >>> >>> -rob >>> >>> >>> --------------------------------------------------------------------- >>> 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