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 Issues in data modules (jdbc, orm, oxm, tx) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

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

Juergen Hoeller commented

Good catch! Thanks for raising this.

@spring-projects-issues spring-projects-issues added type: bug A general bug in: data Issues in data modules (jdbc, orm, oxm, tx) status: backported An issue that has been backported to maintenance branches 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 Issues in data modules (jdbc, orm, oxm, tx) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants