Mike Haberman wrote:
> 
> Hi John,
> 
>    Hope I can bug you for a second.  I am working on the new jyve
>    system and I have a question regarding the use of the ID_TABLE.
> 
>    Since all my tables have autoincrement keys can the whole ID broker
>    be bypassed in systems that do provide that function?

If you set the primary key method in the table MapBuilder to
autoincrement, the sql you are seeing should not be generated. 
something like
DataSegmentMapBuilder.setPrimaryKeyMethod(IDBroker.AUTOINCREMENT)  or
maybe TableMap.AUTOINCREMENT, can't remember off the top of my head.  If
you are using torque to generate the map builders you can specify it
like <table name="DataSegment" idMethod="autoincrement">.

> 
> 1.  What is the purpose of the column quanity ?

this is how many ids IDBroker will cache at one time.  If set to 100,
IDBroker will grab 100 ids and hand them out before making another
query.

> 
> 2. before an insert is done,  the following sql gets generated:
> 
> SELECT * FROM ID_TABLE WHERE TABLE_NAME='DataSegment'
> UPDATE ID_TABLE SET quantity = 0 WHERE ID_TABLE_ID = 2
> SELECT NEXT_ID, QUANTITY FROM ID_TABLE WHERE TABLE_NAME = 'DataSegment'
> UPDATE ID_TABLE SET next_id = 0 WHERE TABLE_NAME = 'DataSegment'
> SELECT * FROM DataSegment WHERE 1 = -1
> 
>    If I am using autoincrement keys, shouldn't the above sql not even
> be generated ?

It shouldn't if you have let Turbine know the table is using
autoincrement, see above.

>    What is the purpose of the last query?

I think this is being generated during DataSegmentPeers initial class
loading, is it happening on every insert?

> 
> thanks a ton!
> 
> mike haberman


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to