简体   繁体   English

高hibernate.jdbc.batch_size设置的缺点

[英]Drawbacks of a high hibernate.jdbc.batch_size setting

I increased the hibernate.jdbc.batch_size parameter to 50. This makes batch processings in our application a lot faster, which is great. 我将hibernate.jdbc.batch_size参数增加到50.这使我们的应用程序中的批处理更快,这很好。 Do I need to expect any drawbacks for the "regular" tasks of the application? 我是否需要预期应用程序的“常规”任务有任何缺点? The application responds to web requests and uses a single database connection per request. 应用程序响应Web请求,并为每个请求使用单个数据库连接。 Most of the requests read only from the database, some requests save a few objects (but not hundreds). 大多数请求只从数据库中读取,一些请求保存了一些对象(但不是数百个)。

Thank you very much for sharing your experiences. 非常感谢您分享您的经验。

The hibernate.jdbc.batch_size parameter determines how many statements are send to the database in one call. hibernate.jdbc.batch_size参数确定在一次调用中向数据库发送的语句数。 Having to many statements (a higher number) could result in either an OutOfMemoryException or a timeout on the transaction, when doing multiple statements in a transaction. 在事务中执行多个语句时,必须有许多语句(更高的数字)可能导致OutOfMemoryException或事务超时。

With webrequests you usually have less statements in a transaction. 对于webrequests,您通常在事务中使用较少的语句。 This setting shouldn't influence these transactions. 此设置不应影响这些交易。

Depending on which part of the documentation you read, anywhere between 10 and 50 Hibernate 3.3 chapter 13 or 5 and 30 Hibernate 3.3 chapter 3 is reasonable / recommended. 根据您阅读的文档的哪一部分,在10到50之间的任何地方, Hibernate 3.3第13章或第5 章和第 30 章Hibernate 3.3第3章都是合理/推荐的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 打印 hibernate.jdbc.batch_size - Printing hibernate.jdbc.batch_size 通过显式调用session.flush()设置Hibernate属性hibernate.jdbc.batch_size - Setting Hibernate property hibernate.jdbc.batch_size over explicitly calling session.flush() 如何验证hibernate.jdbc.batch_size是否正常工作? - How can I verify hibernate.jdbc.batch_size is working? hibernate.jdbc.fetch_size 和 hibernate.jdbc.batch_size 有什么区别? - What is the difference between hibernate.jdbc.fetch_size and hibernate.jdbc.batch_size? hibernate.jdbc.batch_size设置为50,不允许在异常期间测试单个更新 - hibernate.jdbc.batch_size set to 50 not allowing to test single update during exception Hibernate JDBC批处理大小不起作用 - Hibernate JDBC Batch size is not working Spring hibernate jdbc批量大小 - Spring hibernate jdbc batch size 当批处理大小很高时,JDBC应用程序会挂起批量插入 - JDBC application hangs for bulk insert, when batch size is high 使用JOINED继承策略并设置spring.jpa.properties.hibernate.jdbc.batch_size时部分保存的实体 - Entity partially saved when using JOINED inheritance strategy and setting spring.jpa.properties.hibernate.jdbc.batch_size 为了开发目的,我可以增加 hibernate 中的 jdbc 批量大小吗? - Can I increase jdbc batch size in hibernate for development purposes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM