Blasius Lofi Dewanto wrote:
>
> Hi Philippe,
>
> > Because JOnAS cannot guess that your methods only access the
> > bean for reading. You have a way to do this, using the
> > isModified method (defined in your deployment descriptor,
> > and implemented in your bean). In that case, storeIfModified()
> > will not store the data.
> What do you mean? I can say in my deployment descriptor,
> that this method only "read-only"? I'm using CMP.
> Is this JOnAs specific? Could you explain this a bit more?
Sure. This is a copy/paste from the jonas documentation:
isModified optimization for container managed entity beans
In order to improve performance we have implemented in JOnAS the isModified extension.
Before
performing an update the container will call
a method of the bean whose name is indicated in the is-modified-method-name element of
the JOnAS
specific deployment descriptor.
This method is responsible to tell if the state of the bean has been changed. Doing
so, the
container is able to know if it must store data in
the database or if it's useless.
Example
The bean implementation manages a boolean isDirty and implements a method that returns
the value of
this boolean: isModified
private transient boolean isDirty;
public boolean isModified() {
return isDirty;
}
The JOnAS specific deployment descriptor indicates that the bean implements an
isModified method:
<jonas-entity>
<ejb-name>Item</ejb-name>
<is-modified-method-name>isModified</is-modified-method-name>
.....
</jonas-entity>
Methods that modify the value of the bean need to set the flag isDirty to true.
Methods that restore the value of the bean from the database need to reset the flag
isDirty to
false. So, be sure to set the flag to
false in ejbLoad() and ejbStore() methods.
>
> Thanks!
> --
> ---------------------------------------------------
> Blasius Lofi Dewanto
> ---------------------------------------------------
> OpenUSS - Open University Support System
> http://openuss.sourceforge.net
> ---------------------------------------------------
> E-Mail : [EMAIL PROTECTED]
> ICQ : 39343280
> ---------------------------------------------------
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
--
Philippe Durieux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bull - 1 rue de Provence - 38432 Echirolles Cedex France
[EMAIL PROTECTED]
-> Download our EJBServer at http://www.evidian.com/ejb <-
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".