Introduction In this article, we are going to see how the SQL Server useBulkCopyForBatchInsert configuration property works when using JDBC, JPA, or Hibernate. SQL Server PreparedStatement batching When using JPA and Hibernate, the generated SQL statements are going to be executed using the JDBC PreparedStatement because prepared statements increase the likelihood of statement caching, and you to avoid SQL injection attacks. By default, when persisting several Post entities: Hibernate generates the following SQL INSERT statements: By default, Hibernate uses the executeUpdate method of the JDBC PreparedStatement, so there’s no batching involved. To... Read More
The post SQL Server useBulkCopyForBatchInsert configuration property appeared first on Vlad Mihalcea.