Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large transaction timeout value (Integer.MAX_VALUE for example) results in transaction expiring immediately after starting. [SPR-16316] #20863

Closed
spring-issuemaster opened this issue Dec 20, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Dec 20, 2017

Razvan Popian opened SPR-16316 and commented

Setting a large transaction timeout value like Integer.MAX_VALUE in the @Transactional annotation causes the transaction to timeout immediately. The problem appears to be in the setTimeoutInSeconds method in the org.springframework.transaction.support.ResourceHolderSupport class. The timeout in seconds is multiplied by 1000. Two ints multiplied in java result in an int so for example Integer.MAX_VALUE * 1000 equals -1000. This is why the transaction times out immediately as described..


Affects: 3.2.18, 4.3.6

Referenced from: pull request #1633, and commits e502541, b9e03cb

Backported to: 4.3.14

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 7, 2018

Juergen Hoeller commented

Good catch! Thanks for raising this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.