At 10.6.1.1, of what I understand, context propagation must be.
Iâm not sure I understand what Romain is saying so I will try to explain
in my own words.
There are 2 things people generally mean when they talk about XA or
two-phase transaction support.
1. One server with more than one transactional resource, typically
databases and messaging. A transaction is started on this one server,
âinsideâ the transaction various DBs and messaging are accessed, and the
transaction is ended. The server âpropagatesâ the transaction to the DBs
etc and uses 2-phase commit to ensure consistent results across resources.
EJB servers have to support this (although they are not required to support
automatic recovery from failure) and Tomee supports this.
2. More than one server, where a transaction is started on one server and
a remote ejb call to another server requires propagating the transaction to
that second server. Supporting this is optional, for good reason. I have
never encountered a situation with non-fossilized code where this is a
remotely plausible architectural choice. Put all the ejbs on the same
server and run multiple copies of the same server. Tomee does not support
this.
Hope this reduces rather than adds to confusion :-)
David Jencks
Post by Yann BlazartWait Romain.
You mean remote ejb TX do not work with tomee ???
Not really, i meant with most servers "by design". Propagation is not
supposed to be done through remote calls.
That is a big problem
Post by Thiago RodriguesHi
Thans for the quick response!
If i remove the MANDATORY from EJB2 everything works fine, but EJB2
perform
Post by Thiago Rodriguesinserts (with XA Oracle Datasource), but if an exception are thrown in
EJB1(after the EJB2 response) all the operations made in ejb1 are
rolledback but the data inserted by ejb2 are commited (probably because
there is no transaction propagation from ejb1 to ejb2 and a new
transaction
Post by Thiago Rodriguesare created). I made this work in other AS such wildlfy and wl... but i
would really like to made this work in tomee.
On Sun, Nov 19, 2017 at 10:33 AM, Romain Manni-Bucau <
Post by Romain Manni-BucauHi
Transactions are local until you use a XA system. EJB doesnt handle
that
ejb1
Post by Yann BlazartPost by Thiago RodriguesPost by Romain Manni-Bucauthen a rollback will be done in both systems.
Hi, I am testing remote server Transaction Context Propagation.
My application is like that and Tomee server version is 1.7.1
call
Server A (EJB 1) ========> Server B (EJB 2)
| |
| |
| |
DB 1 DB 2
.REQUIRES_NEW)
MANDATORY)
Post by Romain Manni-BucauI want to execute EJB 1 which works with DB1, then calls EJB 2 which
works
Post by Romain Manni-Bucauwith DB2
in a single global transaction.
when EJB 1 calls EJB 2 in remote server, It throws
TransactionRequiredLocalException Exception.
How to propagate transaction context to the remote server?
--
Atenciosamente,
Thiago Rodrigues