Resize the sleep mode batch programmatically

Is it possible to programmatically change hibernate.jdbc.batch_size? I understand hibernate.jdbc.batch_size is an application level parameter that wants to know if I can use it specifically for some HQL inserts, and not for others. I would change the code only for those HQL inserts

The big picture is that I need to introduce batch inserts in order to make the web application run in some scenarios, but I don't want to jeopardize the usual inserts that are working right now.

Any pointers will help

thanks Samir

+6
hibernate
source share
1 answer

As far as I know, you cannot change the SessionFactory configuration settings at run time (settings are not displayed through the open API and are not changed).

In other words, I would use a different SessionFactory (and set the hibernate.jdbc.batch_size property in the Configuration object that was used to create it) in specific scripts that need this.

+2
source share

All Articles