db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Broadhead <robbroadh...@mindspring.com>
Subject Re: Idbroker idMethod
Date Tue, 02 Mar 2004 15:28:36 GMT
At 09:09 AM 3/2/2004, you wrote:
>Hello,
>
>I'm a new user of Torque and am trying to understand idMethod usage a
>little better.  If I select to use the idBroker idMethod method for
>primary key generation then am I locked into Torque as the only means
>for inserting data into my tables?  In other words, since Torque will be
>generating the id's then is it true that I shouldn't use another
>mechanism for inserting into a table using idBroker (i.e. direct JDBC
>call or non-Java script access) else Torque and the non-Torque methods
>may try to insert duplicate primary keys?
>
>Thanks,
>David Sica

You can still use other methods you just need to be aware of the id_table 
appropriately named "id_table". The structure is straightforward so it is 
easy to understand. You would grab the next id for the table you are 
inserting into and update the next_id field for that table in id_table. I 
have not used it across a lot of different databases, but it looks like the 
structure and usage is the same in any supported database. I use id broker 
in databases where I am importing legacy data and id values into a new 
database. I just import the data and then adjust the next id value after 
the import is done. There are obviously some issues that may arise based on 
multiple users, but that may not be a problem for your needs.

Hope this helps,
Rob



//--------------------------------------------------------------------
Rob Broadhead - Consultant
RB Consulting Inc.
Rob@RB-SNS.com
//-------------------------------------------------------------------- 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message