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

Modify error message when timeout is less than TIMEOUT_DEFAULT #32635

Closed

Conversation

remeio
Copy link
Contributor

@remeio remeio commented Apr 14, 2024

When timeout is zero(0), this method setTimeout runs normally, it will not throw the IlleglArgumentException. In other words, zero is valid timeout for this method. The valid arguments:

  • TIMEOUT_DEFAULT(-1)
  • Zero(0)
  • Positive integer(>=1)

So, I think non-negative is better in this method.

(Actually when timeout is zero, it will throw TransactionTimedOutException on transaction starting)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 14, 2024
@simonbasle simonbasle self-assigned this Apr 16, 2024
@sbrannen sbrannen added the in: data Issues in data modules (jdbc, orm, oxm, tx) label Apr 16, 2024
@sbrannen sbrannen changed the title fix: Modify the error message for timeout is less than TIMEOUT_DEFAULT. Modify error message when timeout is less than TIMEOUT_DEFAULT Apr 16, 2024
@simonbasle simonbasle added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 16, 2024
@simonbasle simonbasle added this to the 6.1.7 milestone Apr 16, 2024
@simonbasle
Copy link
Contributor

A zero timeout is indeed a valid input, and it is up to the underlying transaction implementation to interpret this.
Of particular note is how this gets interpreted if the 0 is passed down to a Jakarta UserTransaction:

If the value is zero, the transaction service restores the default value. If the value is negative a SystemException is thrown.

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) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants