>I'm trying to track down which EJB methods are called during the transition
>in an Entity bean from Pooled to Ready state.
>
>In particular, for the following circumstance:
>
>- Client invokes findBySomething, which returns a Vector.  (EJB in pooled
>state)

In this case, the bean stays in the pooled state.  As the method does not correspond
to an instance of the entity bean but rather to the home interface that does
not have an identity.

>- Client selects a handle in the Vector

Since the vector is on the client side, nothing happens on the server side.

>- Client calls a business method on the handle.  (EJB in ready state)
>

If there is an active instance for that entity bean in the ready state, the container
*may* call the ejbLoad to synchronize the bean with the DB.  This is container 
specific.
If there is no active bean (ready state) for that entity, the server will choose one
from the pool, call ejbActivate to wake it up and will can the ejbLoad to synchronize
with the database.
This is illustrated in the OIDs in section 9.5 of the spec.

Once the business method is completed, the container may choose to leave the
bean in the ready state or it may decide to passivate it, put it back in the
pool and later affect it to another entity with a different PK.


>According to the EJB 1.1 spec, page 102, the only transitions from pooled to
>ready are via ejbActivate and ejbCreate.
>
>In this case, however, the bean has never been passivated and is not being
>created.

An instance from the pool does not have to be previously passivated to be assigned
to a specific entity.  If the bean exist in the DB, the server will use a bean from
the pool and activate it using information from the DB.

>
>Specifically, I'm wondering if ejbLoad is called during this sequence.  In
>the container I'm playing with, ejbActivate does not appear to be called.

If the bean is already in the ready state, for sure ejbActivate will not be called.
In this case, it is not mandatory to call ejbLoad, that is container specific.

>
>Any thoughts?
>
>Thanks
>-Steve Roth, [EMAIL PROTECTED]

Hope it helps.

Benoit Tremblay (clea informatique)
at Ericsson Research Canada

===========================================================================
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