From 5ad4d680abcd2121fcc0f5f12933e2385f5591d1 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Tue, 6 Feb 2024 17:04:20 +0100 Subject: [PATCH] HHH-17716 implement JtaTransactionAdapterTransactionManagerImpl.setTimeOut() --- .../JtaTransactionAdapterTransactionManagerImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterTransactionManagerImpl.java b/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterTransactionManagerImpl.java index b5f0b9dd3a..7f64f6e57b 100644 --- a/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterTransactionManagerImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/resource/transaction/backend/jta/internal/JtaTransactionAdapterTransactionManagerImpl.java @@ -106,6 +106,13 @@ public class JtaTransactionAdapterTransactionManagerImpl implements JtaTransacti @Override public void setTimeOut(int seconds) { - + if ( seconds > 0 ) { + try { + transactionManager.setTransactionTimeout( seconds ); + } + catch (SystemException e) { + throw new TransactionException( "Unable to apply requested transaction timeout", e ); + } + } } }