简体   繁体   中英

Printing hibernate.jdbc.batch_size

Is there a way to print the batch_size that was set when configuring the sessionFactory's hibernate properties? For Example, throughout my code I can say: sessionFactory.getCurrentSession().getTransaction().getTimeout()

Is there a way to print the batch_size (something like this):

sessionFactory.getCurrentSession().getTransaction().getBatchSize()

Since Hibernate 5.0 , you can get the hibernate properties using SessionFactoryOptions , which can be obtained from SessionFactory . No need to use reflection anymore :

sessionFactory.getSessionFactoryOptions().getJdbcBatchSize();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM