You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Robert Dietrick <rd...@sega.com> on 2003/10/02 03:15:23 UTC

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:
<database
   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