• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate.jdbc.batch_size..

 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone complete the senctences:

The higher the value of "hibernate.jdbc.batch_size", the "... ".

The lower the value of "hibernate.jdbc.batch_size", the "... ".

When and why should I change the of "hibernate.jdbc.batch_size"?



 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The docs cover this. Basically the higher the batrch size the more memory you need, the lower the batchsize the more database round trips you need.
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Paul,

thanks!

I red the docs but your sentence


"Basically the higher the batch size the more memory you need, the lower the batchsize the more database round trips you need. "


enlarges my knowledge about the batch size.

Thanks!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome.
 
Angel Taveras
Ranch Hand
Posts: 84
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's also recommended that you don't use a big batch size because of the usage of the memory, but if this
it's not a problem then you could set a relative high value like 50 or so...

regards,
 
nimo frey
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess, memory is not the problem..i use a size of 1000 and clear my cache after each 1000 objects..
 
Robert Benkovitz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this in the docs:

Hibernate disables insert batching at the JDBC level transparently if you use an identity identifier generator.


Does this mean if you use identity columns on any table in your database, Hibernate will disable insert batching? Or is it context-specific - i.e. if any of the insert statements in the batch are inserting data into tables with identity columns, it will disable batching?

As you can see, I'm a bit confused. Any help would be appreciated.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Does this mean if you use identity columns on any table in your database, Hibernate will disable insert batching?

Yes.
 
Robert Benkovitz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:

Does this mean if you use identity columns on any table in your database, Hibernate will disable insert batching?

Yes.


Dang.

Thanks for the answer!
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic