Open ritratt opened 1 month ago
this should be the case, batch inserts are supported https://github.com/micronaut-projects/micronaut-data/blob/4.10.x/data-jdbc/src/main/java/io/micronaut/data/jdbc/operations/DefaultJdbcRepositoryOperations.java#L1296
Note that some databases don't support returning the ID for a batch insert.
Can you provide an example that reproduces the issue?
Feature description
Using Micronaut-Data 4.6.x. I'm trying to persist multiple rows to my table.
I expected Micronaut to do a batch insert using a single connection+transaction. However, it turns out it not only does one insert per element of
Foo
but it also uses an individual DB connection. This results in performance issues as well as a starved connection pool.I checked the docs and couldn't find a way to do this without writing my own queries, but then that defeats the purpose of using out of the box features that Micronaut Data provides.