Merge pull request #3122 from ebean-orm/feature/3109-jta-txn-fix

#3109 Fix for JtaTransactionManager when no active transaction
This commit is contained in:
Rob Bygrave
2023-06-26 21:30:55 +12:00
committed by GitHub
@@ -78,8 +78,9 @@ public final class JtaTransactionManager implements ExternalTransactionManager {
*/
@Override
public Object getCurrentTransaction() {
TransactionSynchronizationRegistry syncRegistry = registry();
TransactionSynchronizationRegistry syncRegistry;
try {
syncRegistry = registry();
SpiTransaction t = (SpiTransaction) syncRegistry.getResource(EBEAN_TXN_RESOURCE);
if (t != null) {
// we have already seen this transaction