-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
WebSphereUowTransactionManager causes exception for PROPAGATION_SUPPORTS when timeout is specified #25132
Comments
It's not clear to me why |
Also, I suppose you've been using the plain |
The error actually occurs with an operation marked as Your observation is very useful as it reduces considerably the number of operations we'd have to review - I only count a handful actual occurences of |
Please note that timeouts are generally only designed for So the bug in From that perspective, you could simply drop all timeout clauses for |
I vaguely remember using a plain Also, I've already raised some doubts within our team as to actual benefits of these timeouts. I've seen the pattern of "leave no property unset / no feature unused" in more than a few places, and I am willing to investigate some these to simplify things. Also, thank you. Your quick intervention was most unexpected and quite welcome. |
No problem, good to hear this is helpful. We are going to refine the timeout applicability in |
Yes. I've understood what you meant about timeouts being useless in those cases. Adding the weight of your argument here should help me tip the balance in favor of removing them. As a general note, upgrading from version to 1 to version 4 was incredibly straightforward - no big surprises. I'm a long time user and Spring still astounds me, both in technology and process. Looking forward to use version 5 and beyond, in both old and new projects. |
Let's keep this issue open for my planned refinement in Good to hear that the upgrade was so straightforward in general... |
Context
We're upgrading a legacy app from Spring 1.2.8 (yes, for real) to Spring 4.3.6, following best practices and settings things right as we move along. We have everything working up to here except for this bug which required investigation and for which this is the report. Tested on WebSphere 8.5.5 and 9.0. We can't move to Spring 5 yet because of a remaining dependence on Java 7, but I'd be expecting the same behavior from it after looking at the Spring code.
Details
The app is using XML configuration with per-method transaction management declared like so:
Under Spring 4, this results at runtime in WebSphere throwing an exception:
Explanation
After investigation, it turns out that Spring's
JtaTransactionManager
tries to use the WebSphere Local Transaction manager (UOW_TYPE_LOCAL_TRANSACTION
) whenever possible. However, the WAS Local Transaction manager does not support timeouts.Excerpt from IBM's javadoc:
Why it worked before
The Spring 1.2 transaction management was exclusively using the Global Transaction manager, which accepts the declared timeout with no issue.
Workaround
For now, we'll be using our own custom copy of
WebSphereUowTransactionManager
that'll d avoid usingUOW_TYPE_LOCAL_TRANSACTION
whenever a timeout is specified for the transaction. Obviously, a baked-in fix would be preferable, I am willing to supply a PR to that effect, although it would be initially against the 4.3 branch.We'll also be reviewing our declared timeouts for most operations but it is unlikely that we'll get rid of them all.
The text was updated successfully, but these errors were encountered: