vladmihalcea / hypersistence-optimizer

Hypersistence Optimizer allows you to get the most out of JPA and Hibernate. By scanning your application configuration and mappings, Hypersistence Optimizer can tell you what changes you need to do to speed up your data access layer.
https://vladmihalcea.com/hypersistence-optimizer/
Apache License 2.0
306 stars 43 forks source link

Postgresql reWriteBatchedInserts with jdbcurl #199

Closed willome closed 1 year ago

willome commented 1 year ago

I have tried to add to the postgres jdbc url the reWriteBatchedInserts like this: jdbc:postgres:mydb?reWriteBatchedInserts=true but hypersistence optimizer still complaining with the JdbcBatchToBulkInsertEvent event.

Well I am not sure if we can pass this parameter to the driver but according th the documentation,it should work https://jdbc.postgresql.org/documentation/use/)

I would like to avoid setting directly the PgDatasource.setReWriteBatchedInserts. Is it possible ?

vladmihalcea commented 1 year ago

It could be a false positive, but I'll need a replicating test case to debug it, so that I can see why it's not working as expected.

willome commented 1 year ago

My bad, that was my mistake. I am using Testcontainers which automatically adds a loggerLevel on the generated url. I was first using postgreSQLContainer.getJdbcUrl() + "?reWriteBatchedInserts=true" but it must be changed to postgreSQLContainer.getJdbcUrl() + "&reWriteBatchedInserts=true".

vladmihalcea commented 1 year ago

I'm glad you found the culprit.