1 Reply Latest reply on Jul 12, 2006 6:41 PM by jnorris10

    Session bean private methods and CMT:

    jnorris10

      It appears that bean methods for the purposes of CMT demarcation must be public (from looking at the pointcuts in ejb3-interceptors-aop.xml (in jboss 4.0.4/EJB3 RC7).

      I can't find this information explicitly in the spec. The spec states that "business methods" must be public. Am I only able to use CMT on "business methods"? I often want to have private methods on a session bean that still have transactional semantics (ie: annotate them with @TransactionAttribute(...)). Can I not do this? Am I missing something?

      Thanks.

        • 1. Re: Session bean private methods and CMT:
          jnorris10

          I've researched this a bit more and I will answer this myself to the best of my knowledge, just in cased others have the same question.

          "jnorris10" wrote:
          Am I only able to use CMT on "business methods"?


          Yes, since these are the only EJB3 interceptor points defined.

          "jnorris10" wrote:
          I often want to have private methods on a session bean that still have transactional semantics (ie: annotate them with @TransactionAttribute(...)). Can I not do this? Am I missing something?


          No, you can't do this because again only business methods (which are public among other things) are subject to CMT behavior because this is the specified point at which this EJB3 interceptor stack is tied in.