-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Mike Youngstrom opened SPR-6167 and commented
We are using WebSphereUowTransactionManager with Hibernate JPA with Transaction scoped EntityManagers. When I have a transaction with REQURIES_NEW. My transaction synchronizations aren't getting suspended for the new nested Transaction. This causes my interactions with JPA while in the new transaction to throw TransactionRequiredExceptions because the EntityManager isn't joined with the new transaction. If I'm using Atomikos as my JTA provider everything seems to work fine.
I can create a test case if needed. But looking at the code the problem appears to be with this line 242:
SuspendedResourcesHolder suspendedResources = (existingTx && !joinTx ? suspend(null) : null);
If I change the code to:
SuspendedResourcesHolder suspendedResources = (newSynch && !joinTx ? suspend(null) : null);
Everything appears to work fine. I'm hoping you can recognize this as a simple coding mistake. Seems weird that "newSynch" wouldn't factor into determining if the synchronizations are suspended or not.
If you need a test case let me know and I'll see what I can come up with.
Mike
Affects: 2.5.6
Referenced from: commits 90f8e5d
1 votes, 1 watchers