When presenting Java EE 6 and GlassFish v3 at the Lausanne JUG last week I was bombarded with questions (I like that) and I think I didn’t do an ideal job answering the following question (paraphrasing) :
How does the new async feature in EJB 3.1 work wrt transactions?
The precise answer is easy to find in the EJB 3.1 specification itself (paragraph 4.5.3) :
Client transaction context does not propagate with an asynchronous method invocation. From the Bean Developer’s view, there is never a transaction context flowing in from the client. This means, for example, that the semantics of theREQUIRED
transaction attribute on an asynchronous method are exactly the same asREQUIRES_NEW
.
By the way, the entire section on EJB 3.1 asynchronous methods is only two pages.
Great post! That’s a doubt I had when I heard about assync invocation on EJB 3.1