Batch Insert with JPA and Spring
问题 I'm using Spring Framework and JPA to insert beans into my database. I need to insert almost 8000 entities, and this can delay too much. Why should I disable "second level cache" in Hibernate hibernate.cache.use_second_level_cache false When I set a "hibernate.jdbc.batch_size 20" in Hibernate, will it insert my beans like this? INSERT INTO VALUES (1),(2),(3)...(20); INSERT INTO VALUES (21),(2),(3)...(40); The documentation says: "Hibernate disables insert batching at the JDBC level