Save in batch not working

related to Need fast delete method for large sets of entities

up until now I thought my save in batch was working. but now that I enable logging I see individual insert statements for each entity.

Not sure if this is a regression from previous Jmix version. I was convinced I had this fixed.

Hello Tom,

This is expected behaviour. Saving in batches via DataManager still performs individual inserts. The advantage of batching is that it avoids opening a new transaction for each entity.

Regards,
Dmitry

@taimanov

Any experience with jdbc.batch-writing | EclipseLink 2.5.x Java Persistence API (JPA) Extensions Reference

Would this work with Jmix?

jdbc.batch-writing mechanism, according to documentation and sources (e.g. org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism#appendCall), does not transform multiple statements into one. It just sends them to database in one call. However, some database-specific drivers may optimize such batch of statements further.

So, yes, it may improve performance but transformation of a batch to single sql statement is not guaranteed.

By default it is turned off and not checked continuously with Jmix, but I cannot see why it should not work.