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-projects-issues opened this issue Dec 20, 2017 · 1 comment
Assignees
Labels
in: data status: backported type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues 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-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 7, 2018

Juergen Hoeller commented

Good catch! Thanks for raising this.

@spring-projects-issues spring-projects-issues added type: bug in: data status: backported labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0.3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data status: backported type: bug
Projects
None yet
Development

No branches or pull requests

2 participants