4 Replies Latest reply on Oct 22, 2003 3:01 AM by semi

    xdoclet & stateful session bean timeout

    ebdr

      Hi,

      How can I set a timeout to a stateful session EJB using xdoclet?
      If my client session dies (therefore losing the handle to my stateful session bean) does JBoss call ejbRemove() on that stateful EJB?

      Thanks for your help.

      Eric

        • 1. Re: xdoclet & stateful session bean timeout
          semi

          Hi,

          it should work, when you specify the target container using the following xdoclet tag

          @jboss.container-configuration name="The container config in server/default/conf/standardjboss.xml"

          For your second question. Take a look at the Javadoc of a SessionBean.


          public void ejbRemove()
          throws EJBException,
          java.rmi.RemoteException

          A container invokes this method before it ends the life of the session object. This happens as a result of a client's invoking a remove operation, or when a container decides to terminate the session object after a timeout.


          Regards,
          Michael

          • 2. Re: xdoclet & stateful session bean timeout
            ebdr

            Thanks a lot for your help Michael. It was not clear to me from the java doc that the timeout mechanism was handled by the EJB container by default and that I could modify the max-bean-life...

            So if I understand this correctly, I don't need to worry about cleaning up if the client session dies without calling the remove operation. The container is keeping track of the stateful session EJB's activity and will throw the timeout when needed.

            -Eric

            • 3. Re: xdoclet & stateful session bean timeout
              semi

              You can test it writting something to the console in the ejbRemove-method of your ssb. :)

              Regards,
              Michael

              • 4. Re: xdoclet & stateful session bean timeout
                semi

                Take a look at the following document

                http://www.servercomponentpatterns.org/contents/part2.html (EJB_LifecycleCallback.pdf)

                The section "What goes where" is very helpfull.