Hi Marc,
EJB vendors are given 3 options for synchronization with the database. These
options are specified in section 9.1.10 (table 5) of the EJB 1.1 spec. When
choosing an option, vendor may be inclined to synchronize the instance state
with the database (ejbStore) following every method invocation AND at the end of
the transaction. ALL options, however, require that the container synchronize
the instance state with the database at the end of the transaction. Choosing to
synchronize after each method call is up to the vendor and is not required by
the specification.
Richard
--
Author of Enterprise JavaBeans, 2nd Edition
Published by O'Reilly & Associates
http://www.EjbNow.com
Marc Naef-Lendvai wrote:
> Hi Richard,
>
> I thought that this was specified in the standard:
>
> within a transaction:
> - ejbLoad when entering a business method
> - executing business method
> - ejbStore when leaving business method
> commit of those changes only upon commit of the whole transaction in the
> container
>
> That's why one should not implement each object as a entity bean as the
> performance decreases with this behaviour...
>
> best regards
>
> Marc
>
> -----Original Message-----
> From: Richard Monson-Haefel [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 10, 2000 2:08 PM
> To: [EMAIL PROTECTED]
> Subject: Re: What determines when ejbStore and ejbLoad get called?
>
> 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".
>
> ===========================================================================
> 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".
===========================================================================
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".