see below

> -----Original Message-----
> From: Nicolas Preget [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, August 09, 1999 9:54 AM
> To:   [EMAIL PROTECTED]
> Subject:      Lifecycle & getters => poor performance
>
> Hi,
> I noted consulting the archives a lot of questions but few
> answers on this topic.
> Let's say one view need to know the differents
> characteristics (name, profession, phone number) of a
> Person (Entity Bean). To get this, we call the method
> "findAllPersons()" (select distinct oid from Person) which
> returns a collection of EJB object. After that, for each
> person, we call "getPersonData()" (select * from Person
> where oid = ?) supposing that we implemented the
> pass-by-value point of view.
> I wanted to know if there's solutions to improve
> performance for such business methods ??
> In my understanding, when a client calls a business method
> through the remote interface, the container follows this
> way:
>         1. ejbLoad
>         2. business method
>         3. ejbStore
> How can we distinguish read-only methods to modifiers
> methods (implementation of flags ??) in order to call
> ejbStore ONLY when necessary ?
        [Chip Wilson]
        If a business method does not modify an entity, then the method
should not require a transaction and one should not be begun, either
explicitly or declaratively.  No transaction commit, no call to ejbStore.

> And more generally, how can we improve the access to the
> database ??
        [Chip Wilson]
        If you are retrieving collections of read-only objects, try using
the summary pattern.  Create a model object that contains the data required
by the presentation layer, then instantiate a collection of these from a
session bean method by talking directly to the O/R mapping framework.  The
entire collection can be retrieved in a single query, then returned to the
client in one round trip.  If you need to know what entity bean a summary
object represents, include the PK of the entity in the summary object so
that it can be looked up for updates.

> Thanks for your answers
>         Nico
>
> ______________________________________________________
> Bo�te aux lettres - Caramail - http://www.caramail.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