Reputation: 1038
I have noticed the behaviour of the save method performing the insert as a batch when setting spring.jpa.properties.hibernate.order_inserts=true
. The saveAll
is indeed doing the batch insert. But what I found strange is that the save method is doing batch as well.
Is that normal?
Thanks.
Upvotes: 4
Views: 2781
Reputation: 16400
Yes, that is normal. In the end, batching is a Hibernate feature and Spring just calls persist
/merge
on the EntityManager
. Hibernate figures out behind the scenes how it can do batching.
Upvotes: 2