users@ejb-spec.java.net

[ejb-spec users] Re: Transaction context on asynchronous method invocations

From: <yannick.majoros_at_gmail.com>
Date: Mon, 5 Jan 2015 13:10:03 +0000 (UTC)

Hello Willem ;-)

It's asynchronous, so each method has its own transactional context and
its TransactionAttribute, with a TAType defaulting to REQUIRED, which
will create a new transaction in this case.

Both methods can't have the same transaction: the synchronous one would
need to commit the transaction when leaving the transaction context,
but that could happen at very different times.

You could always return a Future from your asynchronous method and wait
for it at some point. Wouldn't that solve all problems that you are
thinking of?

Best regards,

Yannick Majoros