Session Synchronization
because session beans don’t have ejbLoad and ejbStore
The point is this:
An entity bean has ejbLoad() and ejbStore() to tell it when to synchronize with the database. If the transaction is about to commit, ejbStore() is called to give the bean one last chance to get it’s persistent state in order, ready to be written to the database. And if the transaction does not commit, the bean just gets another ejbLoad() to return it to its original pre-transaction state, and everything is fine.
But a session bean doesn’t have that luxury. No ejbLoad()or ejbStore() to tell it when it’s time to synchronize itself with a database. But if your session bean implements SessionSynchronization, you can give a session bean three new container callbacks, that notify the bean of three more special moments in the bean’s transactional life: when a transaction starts, when it’s about to end, and when it’s over.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access