DaveFord wrote:

> What determines when ejbStore and ejbLoad get called?
>

This is dependent on how your server is implemented, but for most servers its
the transaction boundaries that determine when the ejbLoad and ejbStore are
called.  When an entity bean is enrolled in a transaction (accessed within a
transaction context) the ejbLoad is invoked to synchronize its state with the
database before any business methods can be serviced.  When the transaction
ends, all the entity beans enrolled in the transaction have their ejbStore
method invoked by the container so that they can write their changes to the
database.

Some vendors may choose to implement their servers so that the ejbLoad and
ejbStore are called before and after (respectively) each method invocation.
This approach consumes more resources and cycles but may ensure that the entity
bean's state is more current depending on the transaction attribute, database
isolation and concurrency mechanism employed (server managed concurrency vs.
database managed concurrency).

Richard
--
Richard Monson-Haefel
Author of Enterprise JavaBeans, 2nd Edition
Published by O'Reilly & Associates
http://www.EjbNow.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