3 Replies Latest reply on Jun 1, 2004 2:54 AM by aloubyansky

    JBoss 3.2.2 to JBoss 4.0 DR4 now calls ejbStore ?? ignoring

    gmatthews

      I have deployed an app developed under 3.2.2 in JBoss 4.0.0 DR4 that uses BMP Entity beans.

      I use a boolean isModified() method in each bean to prevent ejbStore() being called when there are no changes to make -- but isModified() seems like it's ignored in 4.0.0 DR4.

      Is this the case, or is this broken in 4.0.0 DR4?

      If isModified is no longer supported, what's the alternative? Should I be using jboss.xml and read-only methods?

      Thanks.

        • 1. Re: JBoss 3.2.2 to JBoss 4.0 DR4 now calls ejbStore ?? ignor

          Why do you need the container to invoke isModified() for BMP?

          public void ejbStore()
          {
           if (isModified())
           {
           ...
           }
          }
          


          • 2. Re: JBoss 3.2.2 to JBoss 4.0 DR4 now calls ejbStore ?? ignor
            gmatthews

            I don't need the container to call isModified(), it's just that 3.2.2 does seem to call it, and I wondered why 4.0.0 DR4 now does not.

            Is isModified() no longer supported in 4.0.0 ?

            Note that I'd also changed my code to how you suggest, but noticed there are a whole bunch of chained interceptor calls leading up to the ejbStore -- and that maybe (guessing here) previously the container might have been able to call isModified and avoid all of that.

            I also tried creating a jboss.xml file with read-only methods, but ejbStore is still called even after only a single getValue method has been called on the entity bean. Are there other conditions that must exist in addition to having a jboss.xml file so that ejbStore is not called.


            <enterprise-beans>


            <ejb-name>myEntityBean</ejb-name>
            <method-attributes>

            <method-name>get*</method-name>
            <read-only>true</read-only>

            </method-attributes>


            Thanks.

            • 3. Re: JBoss 3.2.2 to JBoss 4.0 DR4 now calls ejbStore ?? ignor
              aloubyansky

              Yes, isModified was lost. It is fixed now.
              By the spec ejbStore must always be called at the end of the transaction even on clean instances.
              For CMP there is <call-ejb-store-on-clean> element in the jboss.xml. Set it to false to avoid ejbStore invocations on clean instances.