This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It is unclear to me what the role of boolean in "setRollbackOnly(boolean)" is, I believed ask a rollback to Container was made once for all, so "setRollbackOnly()" as in UserTransaction was enough. What is more why is there "unsetEntityContext()" for Entity Beans, while no "unsetSessionContext()" for Session Beans ? For Stateless Beans obviously no use at all but not in Stateful case.
As for unsetEntityContext: if the container removes a *session* bean from the pool it calls ejbRemove on the bean prior to the removal.
But this can't be done for entity beans since creation/removal have a different meaning: ejbRemove is called prior to removing the physical entity itself (not the bean). The bean (now without an idenity) goes back into the pool. If the container decides it doesn't need the bean anymore it will call an additional callback method 'unsetEntityContext' to inform the bean of its intention.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: setRollbackOnly(boolean) and unsetEntityContext()