Himai, thanks for your reply.
SessionSynchronization is used when BMT is used.
A stateful session bean with container-managed transaction
demarcation can optionally implement the javax.ejb.SessionSynchronization
interface or use the session synchronization annotations.
[from EJB3.1 Specification 13.3.4.1]
With CMT, a transaction is committed before a business method completes.
This is true with CMT in Stateless-SB and in Singleton-SB. But these beans cannot implement
SessionSynchronization, while Stateful-SB can [from EJB3.1 Specification 4.3.7].
I guess there should be a reason for such a difference.
If the transaction boundaries also match method boundaries, then everything we can do with
the SessionSynchronization interface can also be done using interceptors. Then what's the point of
this interface?
After another thought, maybe the point of the interface is just to provide a means to
act at transaction boundaries, without having to add interceptors to all methods in
bean's views.