After reading "
how to use batch update feature in the hibernate?" I just wnated to double check a couple of things.
If I want to do batch writes to the database all I have to do is set the property in the config file...
<property name="hibernate.jdbc.batch_size">25</property>
right?
I have a few quick questions about how the batch stuff works.
1) Does Hibernate store the items you are going to insert/update in the session until it reaches it's batch limit, then write everything?
2) If the limit is never reached, I assume it does the batch when commit() is called, is that correct?
3) If I am using the "identity" id generation method and I insert a row with batch enabled, do I have the ability to get the PK from the recently inserted object, even if the batch has not gone off?
4) Finally, is there a limit to the batch_size or a number that you would suggest not going above?
Thanks!
Chris