I'm precisely talking about EJB 3.1, and I know that per specifications a stateless session bean must not implement the SessionSynchronization
interface, but could someone explain to me why ? So, I am not asking for a workaround but I would like to know the reasons behind this restristion.
UPDATE:
I don't think this is related to transaction boundaries, because the container should commit when the business method has completed, as per section 13.6.2.2:
The container attempts to commit the transaction when the business method has completed. The container performs the commit protocol before the method result is sent to the client.
And per The Java EE 6 Tutorial:
Typically, the container begins a transaction immediately before an enterprise bean method starts and commits the transaction just before the method exits. Each method can be associated with a single transaction. Nested or multiple transactions are not allowed within a method.