3 Replies Latest reply on Jul 31, 2002 7:11 PM by dsundstrom

    Can't iterate

    ejain

      I am trying to iterate through a CMR collection of a CMP entity bean from a MDB. Used to work with 3.0 beta. Now the following error occurs:

      "The iterator of a CMR collection may only be used within the transction in which it was created"

      Also, note the spelling error ;-)

      All beans are set to transaction-type "Container". All CMP entity beans have trans-attribute "Required".

      If I add trans-attribute "Required" for the MDBs as well, I get the following warning:

      "[LocalTxConnectionManager$LocalConnectionEventListener] prepare called on a local tx. You are not getting the semantics you expect!"

        • 1. Re: Can't iterate
          dsundstrom

          You need to make sure that the iterattion code is contained within a single transaction.

          • 2. Re: Can't iterate
            ejain

            > You need to make sure that the iterattion code is
            > contained within a single transaction.

            Guessed so, but what is the proper way to configure MDBs to automatically start transactions so that any entity beans (transaction-type=Container, trans-attribute=Required) loaded from within the MDB will be included in the same transaction?

            Anyways, the particular problem could be solved by moving the code that iterates through the CMR collection inside the entity bean.

            • 3. Re: Can't iterate
              dsundstrom

              I thought MDBs were automatically transacted. I suggest you ask in the JMS forum.