| I think I found the reason for this Message: In a JTA-environment you have to use ConnectionReleaseMode.AFTER_STATEMENT (default). So after every single statement the connection has to get released. In our software project and in the test case described in https://issues.jboss.org/browse/WFLY-11213 Entities have an id-column annotated with @GeneratedValue(strategy=GenerationType.IDENTITY). As Vlad Mihalcea wrote in his High-Performance Java-Persistence, Insert-Statements with this GenerationType can not be batched with hibernate. So when you insert new values, hibernate finds out about the GenerationType and executes the statement outside the batch, though batching is active and the insert-statement ist prepared for batch. The connection shall be released after execution but finds out, “oh, there’s still a batch-statement.. I’ll better log that! (and release the connection then)”. The intended statement therfore is executed, data is written but the message is still logged. If this is truly the problem, a fix for this is “simply” -> check, if transaction-type is JTA and entity-to-write with batch has @GeneratedValue(strategy=GenerationType.IDENTITY) then ignore the batch statement, else log it (or do sth. else, as it may be an error). |