db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Eade <se...@backstagetech.com.au>
Subject Re: ID_TABLE question
Date Wed, 25 Feb 2004 05:20:04 GMT
Gautam, Ajay wrote:

>I was wondering if there is a document that explains the inner workings of
>ID_TABLE's NEXT_ID management. Or maybe someone on this list could elobrate
>on the same in view of the following issues:
>
No document exists at this time.

>I have set ID_TABLE to start at NEXT_ID from 1, and QUANTITY to 1;
>#
># ID Broker Default Values
>#
>initialID      = 101
>torque.initialIDValue = 1
>torque.initialIDStep  = 1
>
>As a part of setting up my (MySQL) database, I insert records in some of the
>tables. (example) I insert 2 records in ITEM table, with ID values 1 and 2.
>
>Here are my questions / issues:
>
>1. How does ID_TABLE manage the NEXT_ID field ? Currently, ITEM table has a
>NEXT_ID value of 28806, instead of "3" that I would expect. Similar is the
>case with many other tables. How can I tell ID_TABLE to behave properly ?
>
If you have torque create your tables it should use the torque.initialID 
value when populating the table.

>2. How do I tell ID_TABLE to select max(ID) from the tables that it will
>manage, and use MAX(ID) + 1 as the starting NEXT_ID value ? Inserting values
>in tables does not work, as ID_TABLE has NEXT_ID value which already exists
>in the table !.
>
You can't directly tell torque to do this - you would need to update the 
id table manually and ensure that torque is not prefetching id values.
 From what you are describing you would be better off using 
idMethod="native" and have MySQL manage the ids for you.

>I tried looking into the code, but got impatient, and left that avenue. I am
>tried to search on google, but again got impatient ! :(
>
That's very funny - I got quite impatient composing a response to you.

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



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