Large transaction timeout value (Integer.MAX_VALUE for example) results in transaction expiring immediately after starting. [SPR-16316] #20863
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: