我正在使用一个简单的JpaRepository,调用saveAll()方法。
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批处理?另外,我需要指出我的实体有@GeneratedValue(strategy = IDENTITY)主键。