We have noticed that the transaction rollback behaviour of class AbstractProducedQuery has changed to be JPA-compliant, even for non-JPA contexts, starting with hibernate-core 5.4.2.Final.
We are bootstrapping a SessionFactory (so, no JPA) and the following settings are set: {code: properties java } hibernate.jpa.compliance.transaction=false hibernate.native_exception_handling_51_compliance=true hibernate.jpa.compliance.query=false {code}
With hibernate-core 5.4.1.Final, we are able to catch RuntimeExceptions occuring in AbstractProducedQuery#executeUpdate. Starting With hibernate-core 5.4.2.Final, those exceptions forcibly mark the transaction for rollback.
We are under the impression that while the new JPA behaviour is the new default, it should still be possible to switch to the old behaviour. Otherwise, this blocks us from updating until we have migrated our code.
The offending change has been introduced in the following commits: * [https://github.com/hibernate/hibernate - orm/commit/634782fef69ed0dc80d49fae27c8e5d7fb2c8b84#diff-b5dfdbf6138bc8d85d25b55b60a28033| https://github.com/hibernate/hibernate-orm/commit/634782fef69ed0dc80d49fae27c8e5d7fb2c8b84#diff-b5dfdbf6138bc8d85d25b55b60a28033 ] * [https://github.com/hibernate/hibernate - orm/commit/4665fd9cd94787e3fbdd3a11a1614394c6c0fbd8#diff-b5dfdbf6138bc8d85d25b55b60a28033| https://github.com/hibernate/hibernate-orm/commit/4665fd9cd94787e3fbdd3a11a1614394c6c0fbd8#diff-b5dfdbf6138bc8d85d25b55b60a28033 ]
I have made an example project to show the problem. The included test does not work for hibernate-core >5.4.1: [https://github.com/0x442E472E/HHH-13538|https://github.com/0x442E472E/HHH-13538|smart-link] |
|