ssosso (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYmE1ZDM4MDc5...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-14062?atlOrigin=eyJpIjoiYmE1ZD...
) HHH-14062 (
https://hibernate.atlassian.net/browse/HHH-14062?atlOrigin=eyJpIjoiYmE1ZD...
) @Transactional timeout attribute wrong work (
https://hibernate.atlassian.net/browse/HHH-14062?atlOrigin=eyJpIjoiYmE1ZD...
)
Change By: ssosso (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
!1 (cca38fb1-5eec-4a43-92cf-de14bc8fbb7d).png|width=672,height=82!
!2 (a9640152-45ff-46b7-bc19-8d62af5f0cb9).png|width=855,height=199!
org/hibernate/engine/jdbc/internal/JdbcCoordinatorImpl.class([242
line|https://github.com/hibernate/hibernate-orm/blob/5963dc7fe8/hibernate...])
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}
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 please refer to my PR.
(
https://hibernate.atlassian.net/browse/HHH-14062#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14062#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100128- sha1:078e4e4 )