| org/hibernate/engine/jdbc/internal/JdbcCoordinatorImpl.class(242 line) If set as @Transactional(timeout=1), the transaction timeout will fail unconditionally due to the current timeout checking logic. This is because the / (divide) operation is used. When set as @Transactional(timeout=1),
(Timeout upper limit date and time - Transaction end date and time) / 1000
is always 0 (zero). Therefore, TransactionException is always caused by the following logic.
if (secondsRemaining <= 0) {
throw new TransactionException( "transaction timeout expired" );
}
I am considering this as a bug, so I suggest to fix the code as below.
if (secondsRemaining *<* 0) {
throw new TransactionException( "transaction timeout expired" );
}
If necessary, I will PR. |