Changing hibernate batch size programmatically

前端 未结 1 2006
轮回少年
轮回少年 2021-01-18 09:50

Is possible to change hibernate.jdbc.batch_size programmatically? I understand hibernate.jdbc.batch_size is a application level parameter, wanted to know if I can use it sp

1条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-18 10:17

    To my knowledge, you can't change the configuration settings of a SessionFactory at runtime (the settings are not exposed via the public API and are immutable).

    In other words, I would use another SessionFactory (and set the hibernate.jdbc.batch_size property in the Configuration object used to build it) in the specific scenarios needing it.

    0 讨论(0)
提交回复
热议问题