HI, I always wandered why the identity generator needs to assign an identifier prior to flushing. Because of this behavior, the JDBC batching is disabled which is bad news for MySQL where most setups use IDENTITY instead of TABLE generation type.
Since the AbstractSaveEventListener supports the shouldDelayIdentityInserts option for when there is no transaction n progress, we could make this a default anyway. If the inserts are delayed to flush-time, we could batch them based on the current dialect. Only the SQL Server dialect and Oracle 11g don't allow fetching the resulting keys from a batch. But Oracle 12c (which supports IDENTITY), PostgreSQL and MySQL can save a batch of inserts and fetch the generated keys. If I judge from a Stack Overflow perspective, most questions are in the context of MySQL, so many Hibernate users use MySQL in fact. What do you think? Should we make this change and allow MySQL users to batch JDBC inserts even for IDENTITY. Vlad _______________________________________________ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev