!1 (cca38fb1-5eec-4a43-92cf-de14bc8fbb7d) .png| thumbnail width=672,height=82 !
!2 (a9640152-45ff-46b7-bc19-8d62af5f0cb9) .png| thumbnail width=855,height=199 ! org/hibernate/engine/jdbc/internal/JdbcCoordinatorImpl.class([242 line|https://github.com/hibernate/hibernate-orm/blob/5963dc7fe8/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/JdbcCoordinatorImpl.java#L242])
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),
{code:java} (Timeout upper limit date and time - Transaction end date and time) / 1000 {code} is always 0 (zero).
!3 (0e92237d-95aa-42dd-873c-fb13416d9bc1).png|width=643,height=1280!
Therefore, TransactionException is always caused by the following logic.
{code:java} if (secondsRemaining <= 0) { throw new TransactionException( "transaction timeout expired" ); } {code}
!3.png|thumbnail!
I am considering this as a bug, so I suggest to fix the code as below.
{code:java} if (secondsRemaining * < * 0) { throw new TransactionException( "transaction timeout expired" ); } {code}
If necessary, I will PR. |
|