Sunday, March 5, 2006

EJB 2.0 SLSB versus SFSB

Almost every engineer I talk with is riddled with apprehensions about EJBs. I can understand why they would consider Entity Beans as "useless", "c

One benefit of SFSB is that they can receive transaction notifications by implementing SessionSynchronization interface. The transactions can span multiple methods, across multiple calls (with BMT).

The interface provides 3 hooks "afterBegin","beforeCompletion", and "afterCompletion", these methods provide significant control over the transactions. Horizontal application functionality can be placed in these hooks for transactions.

Several applications of this interface come to mind, one could log certain transactions, notify support on all rollbacks, add a simple layer of authorization etc.