2 Replies Latest reply on Dec 16, 2002 8:37 AM by Nicolas Regez

    Transactional context of ejbRemove, SessionSynchronization

    Nicolas Regez Newbie

      Hello

      Version: JBoss 3.0.4. I have written a SFB with associated remote interface where the client is supposed to begin a UserTransaction before calling a sequence of business methods. When the client commits, I want to make sure the last business method has been called by checking a state variable of the session bean, and depending on the state, initiate a rollback. Therefore, I have implemented SessionSynchronization.

      Now the problem I encounter:

      The container calls the ejbRemove method in its own transactional context and also calls the three methods of SessionSynchronization I implemented in my bean. I have not found anything concerning this topic in the EJB2.0-Spec, nor do I, as a beginner with JBoss, quickly find the right place to look at in source code. Is the transaction, withing which ejbRemove gets called, according to specs? Is there a way to tell that the method afterBegin() was called while attempting to remove the bean and not within a business method or an explicit UserTransaction?

      Thank you very much for your help.