db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Dietrick <rdietr...@sega.com>
Subject Oracle sequences for id generation
Date Thu, 02 Oct 2003 01:15:23 GMT
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-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message