所以我使用一个简单的 JpaRepository 和保存全部()方法被调用。
hibernate.jdbc.batch_size = 500
hibernate.order_inserts = true
hibernate.generate_statistics = true
运行应用程序后:
8045055 nanoseconds spent acquiring 1 JDBC connections;
0 nanoseconds spent releasing 0 JDBC connections;
137189246 nanoseconds spent preparing 1158 JDBC statements;
1417689514 nanoseconds spent executing 1158 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
0 nanoseconds spent performing 0 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
16270990 nanoseconds spent executing 1 flushes (flushing a total of 1158 entities and 0 collections);
0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
任何人都可以看到 0 执行 JDBC 批处理的原因吗?
另外,我必须指出,我的实体有@GenerateValue(策略=身份)首要的关键
Hibernate 不使用身份标识符生成器执行插入批处理。
更多信息是here.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)