2 Replies Latest reply on May 29, 2003 7:48 AM by pmills

    Illegal transaction state

    pmills

      I'm getting the "A CMR collection may only be used within the transaction in which it was created" message in JBoss 3.0.4, but it doesn't seem logical...which probably means I'm missing something basic.

      I have a ClubEntityBean with a getMembers() CMR method. I attempt to call the method from a ClubSessionBean and it dies on a Collection.iterator() call. (The process starts with a useBean tag in a jsp page.)

      If I mark the ClubEntityBean as having transactions Mandatory and the ClubSessionBean as RequiresNew. The error changes to "Transaction required".

      I was assuming that requiring a new transaction before invoking the entity bean would satisfy the "Mandatory" state, but the entity bean seems not to recognize it.

      Suggestions?

        • 1. Re: Illegal transaction state

          Turn on TRACE logging for
          org.jboss.ejb.plugins.TxInterceptorCMT

          You will be able to see where transactions
          start and stop and which methods are invoked

          Regards,
          Adrian

          • 2. Re: Illegal transaction state
            pmills

            Thanks for the suggestion; I'll try that.

            I was able to find a workaround by creating a new method in my entity bean which called getMembers and returned a transformation of the data in a new form (Vector). Then I put a RequiresNew constraint on *that* method and everything went fine.

            So it appears that the logic was acceptable as long as it didn't cross bean boundries as a CMR Collection.