Utilising isModifiedFlag in CMP

Discussions

EJB design: Utilising isModifiedFlag in CMP

  1. Utilising isModifiedFlag in CMP (2 messages)


    Hi,

    We are about to start putting together a EJB application and at the moment we are collecting/evaluating the various design patterns/strategies that are suggested in this excellent site and others. One that caught my attention was the ability to restrict the app. server saving state after every method call. It sounds like a good idea, but I cannot see where I tell the container (remember CMP) to _not_ save, given the ejbstore() method returns null. My test method looks like the following at the moment:

    public void ejbStore(){
          if (!this.isModified) {
            return;
          }
          System.out.println("saving data");
          this.isModified = false;
        }

    What am I missing here?

    thanks,

    Paul.

    eBanking project
    Lugano, Switzerland.

  2. Utilising isModifiedFlag in CMP[ Go to top ]

    The isModified() method is a proprietary read-only control used in Weblogic. If you used this approach at all, it would only work in weblogic. In my mind, any CMP implementation worth its salt, wouldnt call ejbStore() if data was only read. For instance, in our object caching, we compare the in-memory states of the bean, and if the old values and new values are the same, we dont call ejbStore(). This is a feature of Sybase EAServer and doesnt require you to write proprietary calls. Thats the idea of CMP remember.....

    Dave Wolf
    Internet Applications Division
    Sybase
  3. Utilising isModifiedFlag in CMP[ Go to top ]

    Dave,
    Just curious how do you implement " compare the in-memory states of the bean":
    internal memcmp
    or message digest
    or field by field
    something else..?

    Also
    if modification is detected,you goona write the whole bean
    back to the table or only the part that get modified?