2

Now I have working batch inserts with hibernate ("hibernate.jdbc.batch_size = 50) but as far as i know hibernate generates single inserts in batches. I know that I can tell my db driver to create multi-row insert for every batch of inserts to speed up performance using rewriteBatchedStatements: jdbc:postgresql://localhost:5432/mydb?rewriteBatchedStatements=true

But in db logs there are still single inserts. What am I doing wrong? Thanks.

Jack
  • 405
  • 1
  • 5
  • 16

1 Answers1

3

This actually has nothing to do with Hibernate. The inserts are handled by the JDBC driver.

rewriteBatchedStatements is a MySQL specific parameter so it won't work with a PostgreSQL database. If you really need to do bulk inserts with PostgreSQL, take a look at this other answer which explains how to do it.

Community
  • 1
  • 1
Tunaki
  • 116,530
  • 39
  • 281
  • 370