Comments (11)
I assume that Agroal is swallowing the exception so just report that as the root cause, ie changing the JTA enlistment semantics is not the correct approach. Note that there is an open PR to allow mulitple XA unaware resources (#40365) .
from quarkus.
I assume that Agroal is swallowing the exception
@mmusgrov There is no exception from Narayana here, just a method returning a boolean:
so just report that as the root cause
I can't, see above :)
Note that there is an open PR to allow mulitple XA unaware resources (#40365) .
Yes I'm aware of that, having been involved quite a bit xD As we discussed though, this is a temporary solution. We need to think of longer term solutions, and providing clear exception messages when someone tries to do something incorrect is the first step.
from quarkus.
So can we enable arjuna logging (unless there are already warnings) to see why the enlist call returns false?
from quarkus.
If "Agroal 2.3+ now makes it possible to detect that an application is accessing two non-XA datasources in a transaction" why does it still attempt the enlistment?
from quarkus.
I need more information in order to provide a better analysis of why the enlist is failing.
from quarkus.
@shawkins and @yrodiere Also note that in the multiple one phase aware resources case, if the first one phase aware resource commits and the second one rolls back then overall result reported back to the caller is rollback even though the first one committed (they ought to get a heuristic outcome) and I am fixing that at the moment (I'm on a national holiday today so it may have to wait until tomorrow to be completed). Since we never anticipated use of multiple one phase resources I am busy testing it now and writing test cases where I find deficiencies.
from quarkus.
If "Agroal 2.3+ now makes it possible to detect that an application is accessing two non-XA datasources in a transaction" why does it still attempt the enlistment?
It "makes it possible to detect" by implementing that LastResource*
interface. Agroal doesn't do the detection itself, Narayana does, during enlistment, and it just returns a boolean with no information that Agroal can pass over to the user.
@shawkins and @yrodiere Also note that in the multiple one phase aware resources case, if the first one phase aware resource commits and the second one rolls back then overall result reported back to the caller is rollback even though the first one committed (they ought to get a heuristic outcome) and I am fixing that at the moment (I'm on a national holiday today so it may have to wait until tomorrow to be completed). Since we never anticipated use of multiple one phase resources I am busy testing it now and writing test cases where I find deficiencies.
Good to know, thanks. And this all definitely can wait until tomorrow (or later) as far as I'm concerned, so don't feel forced to work today :)
from quarkus.
So is the test adding the two XA unaware resources with the allowUnsafeMultipleLastResources property implemented and set? If so then that is probably enough for me to reproduce the problem. But if the test is doing something else then I need more information to determine why the second resource is being rejected.
from quarkus.
So is the test adding the two XA unaware resources with the allowUnsafeMultipleLastResources property implemented and set? If so then that is probably enough for me to reproduce the problem.
@mmusgrov Yes with allowUnsafeMultipleLastResources not enabled, then the second Connection access like this shawkins/quarkus-quickstarts@014e306#diff-761c636458b29cbabf9e4f4b500472088e222e1310327cade67b7db30a8febb0R25 will result in the exception in the description.
The AddOutcome is AR_DUPLICATE, but the calling logic is treating that the same as AR_REJECTED - https://github.com/jbosstm/narayana/blob/ae4755680f1e5dc7988f8525d1352d24a8adfffd/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java#L638
from quarkus.
So is the test adding the two XA unaware resources with the allowUnsafeMultipleLastResources property implemented and set?
You don't need allowUnsafeMultipleLastResources
. This exception arises when you access two non-XA datasources in a single transaction, which by default is not allowed since Quarkus 3.8.2, as we're all quite aware by now :)
This is the exact problem we've been discussing for the past week(s), but I'm talking about a different improvement in that area:
- Previous GitHub issues/PRs were all about finding workarounds for people who need to use two datasources in the same transaction (temporarily, because it's a bad idea).
- This GitHub issue is about making sure that when it's not allowed (the default), the exception message people get is actionable, i.e. explains what's wrong exactly (at least) and what can be done to avoid it (ideally).
If so then that is probably enough for me to reproduce the problem. But if the test is doing something else then I need more information to determine why the second resource is being rejected.
Just access two Agroal, non-XA datasources in the same transaction, in Quarkus 3.8.2 or 3.9.latest or 3.10.latest or Quarkus main, and you'll get this exception.
from quarkus.
Thanks @shawkins , I'll look into creating a narayana unit test to duplicate this behaviour.
from quarkus.
Related Issues (20)
- OpenAPI auto-add-tags feature can't work with interface and some quarkus.rest.path processing errors. HOT 1
- quarkus disposal method called in wrong order
- codestart are using legacy properties still HOT 2
- Application thinks quarkus.http.host is set to 0.0.0.0 in dev mode but it's set to localhost HOT 2
- Update ubi8/openjdk-VERSION from 1.18 to 1.19
- quarkus-oidc ignores jvm proxy configuration and clashes with oidc-client when both proxies are set HOT 8
- Add filtering to dev-ui (with local-storage memory) HOT 1
- OIDC: injecting a `UserInfo` breaks startup HOT 11
- Cannot mock `EntityManager` methods with `@InjectMock Session`
- add property to configure allowed devui origins HOT 5
- code.quarkus.io templates not updated to new config changes HOT 3
- [Extension Proposal] Statiq an extension to generate static pages from your Quarkus web-app HOT 15
- Wrong transaction state for broken database connection
- OIDC and OIDC-CLIENT extensions should consider JVM HTTP proxy configuration HOT 1
- add Liquibase config option allowDuplicatedChangesetIdentifiers HOT 4
- Issues in verifying signature of bearer token generated for Azure AD HOT 8
- Quarkus `3.10.0` now requires a GraalVM installation for quarkusDev when `quarkus.native.enabled` is set to true HOT 2
- Remote development mode: SmallRyeOpenApiProcessor throws AccessDeniedException: /target HOT 4
- Remote development mode: access denied on /deployments files
- Remote development mode: RemoteSyncHandler interrupted exception
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quarkus.