The @Asynchronous
method creates a new transaction (even if the class has another attribute, the TransactionAttributeType.REQUIRED
will create a new transaction anyway).
Now, if you call get()
method in Future<V>
the thread will wait until the AsyncResult becomes available at the end of computation. After that, the Stateful could execute the timeout and will be destroyed by the container.
If you just execute the Async method -without get()
-, the method will be queued and processed, then, the same applies... Stateful destroyed.
pro tip: the ejb container maintains the result value for complete asynchronous invocations for a certain time (this time is not defined in the spec).
All in all, because a new transaction occurs, and the control is returned to the client immediately (unless call get()
), the transaction finished without exceptions under a normal scenario.