[
https://issues.jboss.org/browse/WFLY-10258?page=com.atlassian.jira.plugin...
]
Ondra Chaloupka edited comment on WFLY-10258 at 4/20/18 8:48 AM:
-----------------------------------------------------------------
[~dmlloyd] a good point, agree and on top of it I can see you already implemented the
functionality ;-P
Anyway, if you permit a small side step:
I think it would be a hard to involve your idea about using {{XAResource.end}} call to
decide about the resource future. First the {{XAResource}} API is not providing way to
return a value back to the caller
(
https://docs.oracle.com/javaee/7/api/javax/transaction/xa/XAResource.html...).
The other issue is the Narayana implementation which calls the {{.end}} just before
{{prepare}} call on the each {{XAResource}}
(
https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com...).
Refactoring the code and moving the {{end}} call to some top-level place where the
decision about 1PC/2PC is done
(
https://github.com/jbosstm/narayana/blob/master/ArjunaCore/arjuna/classes...)
I consider difficult.
Back to the prior point:
As I was investigating your point I can see that the wfly transactional client delists
itself from the current transaction in {{beforeCompletion}} calllback when it knows there
was no work done
(
https://github.com/wildfly/wildfly-transaction-client/blob/master/src/mai...).
That's good but delisting at the Narayana side
(
https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com...)
seems not removing the xa resource from the list
(
https://github.com/jbosstm/narayana/blob/master/ArjunaCore/arjuna/classes...)
which defines if 1PC is applied.
*/edit* I found the started discussion at the forum:
https://developer.jboss.org/message/982119
was (Author: ochaloup):
[~dmlloyd] a good point, agree and on top of it I can see you already implemented the
functionality ;-P
Anyway, if you permit a small side step:
I think it would be a hard to involve your idea about using {{XAResource.end}} call to
decide about the resource future. First the {{XAResource}} API is not providing way to
return a value back to the caller
(
https://docs.oracle.com/javaee/7/api/javax/transaction/xa/XAResource.html...).
The other issue is the Narayana implementation which calls the {{.end}} just before
{{prepare}} call on the each {{XAResource}}
(
https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com...).
Refactoring the code and moving the {{end}} call to some top-level place where the
decision about 1PC/2PC is done
(
https://github.com/jbosstm/narayana/blob/master/ArjunaCore/arjuna/classes...)
I consider difficult.
Back to the prior point:
As I was investigating your point I can see that the wfly transactional client delists
itself from the current transaction in {{beforeCompletion}} calllback when it knows there
was no work done
(
https://github.com/wildfly/wildfly-transaction-client/blob/master/src/mai...).
That's good but delisting at the Narayana side
(
https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com...)
seems not removing the xa resource from the list
(
https://github.com/jbosstm/narayana/blob/master/ArjunaCore/arjuna/classes...)
which defines if 1PC is applied.
/edit I found the started discussion at the forum:
https://developer.jboss.org/message/982119
Prevent enlisting additional resources on EJB caller side in case of
server side @RequiresNew
---------------------------------------------------------------------------------------------
Key: WFLY-10258
URL:
https://issues.jboss.org/browse/WFLY-10258
Project: WildFly
Issue Type: Bug
Components: EJB, Transactions
Affects Versions: 12.0.0.Final
Reporter: Jörg Bäsner
Scenario:
- server-1 (intermediary)
-- Running standalone profile
-- Has a remote-outbound-connection pointing at server-2 through server-2's public IP
address
-- Intermediary bean need to lookup the Target bean in server-2 and also inject the
{{TransactionManager}}
-- Intermediary bean need to enlist a _dummy_ XAResource
- server-2 (target)
-- disable {{JBOSS-LOCAL-USER}} auth
-- Target bean needs to be annotated with {{@REQUIRES_NEW}} (important)
- Standalone EJB client invokes an intermediary bean server-1, which as a result invokes
target bean on server-2.
The _dummy_ XAResource should log in the {{commit}} method whether one-phase optimization
is being used like:
{code}
@Override
public void commit(Xid arg0, boolean onePhaseOptim) throws XAException {
logger.info("-- Committing in the client resource. One-phase optimisation
is: " + onePhaseOptim + " --"
+ (onePhaseOptim ? "" : " -> TWO-PHASE COMMIT
!!!"));
}
{code}
In this scenario it is expected that the one-phase optimization is being used!
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)