All,

In weblogic example: examples.ejb.basic.containerManaged.AccountBean,
isModified()/setModified() are used.

In CMP class AccountBean, the following public methods are defined:

private transient boolean isDirty;
public boolean isModified() {return isDirty}
public void setModified(boolean flag) {isDirty=flag;}
...
public void ejbLoad() {..}
public void ejbStore() {
..  setModified(false);
}
...
public double deposit(double amount) {
.. setModified(true); ..
}
public double withdraw(double amount) throws ProcessingErrorException {
.. setModified(true); ..
}
public double balance() {..}
public String accountType() {..}

My question is:
Why only setter methods deposit() and withdraw() setModified(true)?  In
getter methods balance() and accountType(), do we need to
setModified(false)?  If we don't, then, if the bean was activated after
passivation, the transient field isDirty was **arbitrarily** (Per Richard's
EJB book) set to true, then, the ejbStore() will be called unnecessarily
after calling the setters.

Thanks.

Ruoqi

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to