3 Replies Latest reply on Sep 1, 2002 8:38 AM by sarojk_singh

    Key Generator from Floyd Marinescu ?

    ludovic

      I'm trying to use the key generator from Floyd Marinescu, the first pattern described in his book "EJB Design Pattern".

      This is my problem :

      When I call getNextNumberInSequence(String name) method, I haven't got any returnment, it always running.

      So, what do I change in the source code to use this pattern with jboss3.0 and hypersonic ?

      Where do I must to call this method ? Before or during creating the bean using a compoundkey with the id returned.

      Thanks.

        • 1. Re: Key Generator from Floyd Marinescu ?
          sarojk_singh

          Hi,

          Just change your DD's container-transaction as :

          ORIGINAL
          ***********
          <container-transaction>

          <ejb-name>SequenceSession</ejb-name>
          <method-name>*</method-name>

          <trans-attribute>Required</trans-attribute>
          </container-transaction>

          NEW ONE
          *********
          <container-transaction>

          <ejb-name>SequenceSession</ejb-name>
          <method-name>getNextNumberInSequence</method-name>

          <trans-attribute>Required</trans-attribute>
          </container-transaction>

          Thanks,
          Saroj

          • 2. Re: Key Generator from Floyd Marinescu ?
            sarojk_singh

            Hi,

            Just change your DD's container-transaction as :

            ORIGINAL
            ***********
            <container-transaction>

            <ejb-name>SequenceSession</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>

            NEW ONE
            *********
            <container-transaction>

            <ejb-name>SequenceSession</ejb-name>
            <method-name>getNextNumberInSequence</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>

            Thanks,
            Saroj

            • 3. Re: Key Generator from Floyd Marinescu ?
              sarojk_singh

              Change the dd from


              <container-transaction>

              <ejb-name>SequenceSession</ejb-name>
              <method-name>*</method-name>

              <trans-attribute>Required</trans-attribute>
              </container-transaction>

              *** TO ***

              <container-transaction>

              <ejb-name>SequenceSession</ejb-name>
              <method-name>getNextNumberInSequence</method-name>

              <trans-attribute>Required</trans-attribute>
              </container-transaction>