-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Batch inserts with native id generator
PostPosted: Mon Jun 27, 2005 3:09 pm 
Regular
Regular

Joined: Thu Apr 29, 2004 5:08 pm
Posts: 56
Location: Montreal, Quebec, Canada
Reading Hibernate doc, I spotted:

"...We use the UUID generator (only recommended for testing, as integer surrogate keys generated by the database should be prefered..."

It is possible to have Hibernate to perform batch inserts of objects having a native id-generator (an id generated by the database)?

From my observation, it doesn`t work. As soon as you do session.save( object ), the insert statement is sent to the db, not added to a batch just like it would do with a assigned id-generator, for example.

I understand hibernate immediatly send the SQL Statement because it wants to retrieve the generated id and put it in the object however, I don't need that for my use case. All I want to do is regroup a certain amount of objects, insert them in a batch and clear the session.

Our product is cross-db. Alot of users work in cooperation on the network, I absolutely need the database to generate surrogate keys. At the same time, I need batch-inserts, because it minimize round-trips to the db and I can see a huge performance boost.

Thanks.

_________________
- Frank


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.