Transaction passed to Hibernate Interceptor methods is null when JTA is used

Description

Create and register a hibernate interceptor that touches transaction provided by afterTransactionCompletion(Transaction tx)

This is related to WFLY-11832. Description is copied.

With Wildfly 13 - javaee7 transactions in hibernate interceptors were never null.
Since Wildfly 14 - javaee8 transactions in hibernate interceptors are always null.

Attached sources and a jar of a minimal reproducer for Wildfly 16. This is reproducible by using a fresh unchanged Wildfly 16 and unchanged standalone.xml. Extract Wildfly 16, drop in the jar in the deployments folder and start the server.

Environment

None

Activity

Show:
Markus Chur
March 19, 2019, 7:13 AM

Hey Gail,
is it possible to fix this in 5.3.10? Wildfly is still on 5.3.x and I would like to change the modules as soon as a fix is available.

Gail Badner
March 20, 2019, 12:03 AM

, this will be fixed in 5.3.10, since it's a regression introduced since 5.1. It will probably be a couple of months before 5.3.10 is released though.

Markus Chur
March 21, 2019, 6:40 AM

Thank you Gail! I checked out 5.3.9, applied the fix, and replaced hibernate-core in Wildfly modules with a snapshot. I can confirm that when setting "hibernate.jta.allowTransactionAccess" to true my Hibernate interceptor is working again

Gail Badner
March 29, 2019, 10:08 PM

, thanks for checking!

Gail Badner
April 19, 2019, 7:34 AM

Fixed in 5.3 branch as well.

Fixed

Assignee

Gail Badner

Reporter

Markus Chur

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.1.14

Components

Affects versions

Priority

Major
Configure