Amit,

You should never invoke Container callback methods from your
bean code. If your AppServer supports the Transaction Commit
Option C (we do :), then beans in the transactional state
(where business methods are executed) will return to the pool
at the end of the transaction. For beans to move into the
transactional state again from the pool [in Option C], the
Container will have to invoke the ejbActivate(), followed by
other Container callback methods.

ejbActivate() only associates an instance with its primary
key - in other words, an identity. And on a similar vein, the
ejbPassivate() disassociates an instance with its identity
(that is, goes back back to the pool).

Note that transaction commit option C is slower than B when
your application exhibits locality of reference.

-krish

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development 
[mailto:[EMAIL PROTECTED]]On Behalf Of Amit Kumar
Sent: Friday, August 02, 2002 11:29 AM
To: [EMAIL PROTECTED]
Subject: corected question on ejbActivate()


my previous mail contain some typos here is the correct mail

In an Entity Bean corresponding to ejbActivate() method please correct me if my 
understanding is not correct:

A bean after creation goes to pool. If some client calls create then a bean is picked 
up from the pool and then its ejbCreate()
followed by
ejbPostCreate() is called. Now if come business mehtod is invokded it will be 
executed. In this way ejbActivate() doesnot get a
chance be executed ,so if I
want to ensure that the ejbActivate() must have been called before any business method 
execution I must call ejbActivate() from the
ejbPostCreate().

Best regards
Amit K

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