It's a little more complex than that, but yes.
What is kept in the pool are "empty" instances of the bean's implemetation
class.
for creation:
When create() is invoked on an EJB home, an EJB object is created and
assigned to
one of these instances. Then the arguments (if any) of the create() method
are delegated to the corresponding ejbCreate() method in the bean instance.
for a find:
The same as above, except the bean instance is populated with values from
the database
(when using CMP) after the ejbActivate() method is invoked on the
instance--ejbLoad is called afterwards to notify the bean that persistent
fields have been populated with data from the database. When using BMP
(you're absolutely right), the ejbLoad method is called after ejbActivate
and it is resonsible for populating these data fields
This allows clients to maintain connections to an EJB object, but also
allows the server to
passivate bean instances until they're needed. I suppose EJB objects might
be pooled as well, but I have no idea if they are in JBoss.
The odd behavior I've noticed is that when create() is invoked on an
Entity's EJB home, data fields that are not initialized in the corresponding
ejbCreate() method in the implementation class are being populated with
(cached ??) data from the most recently activated (i.e., via a
findByPrimaryKey() ) Entity bean instance of the same type.
Does anyone have a definitive answer as to why this happens?
joe
>>>>> "Joe" == Joe Barefoot <[EMAIL PROTECTED]> writes:
Joe> I don't have a definite answer for this odd behavior, but I've
Joe> noticed the same thing. This seems to happen anytime you don't
Joe> initialize the data fields of your entity bean in the ejbCreate()
Joe> method.
It is my underdanding that entity and stateful session bean objects are kept
in a pool that the container swaps data into on demand by calling ejbLoad
for
performance rather than creating new object everytime. What are those
states
again? Pooled -> Ready, and so on.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]