Paraphrasing the spec, a current transaction context does not "enclose"
either ejbActivate nor ejbPassivate if (and when) the server determines that
these "house-keeping" calls are necessary.

I use the following example to illustrate the effects of ejbActivate and
ejbPassivate.

Let's assume that the server is running low on usable bean instances in the
instance pool and needs to passivate an instance to service your call on an
EJBObject that you made in a specific transaction context. Both the
ejbPassivate and the following ejbActivate on a server chosen instance will
be called outside of the scope of your transaction. If for any reason you
(or the system) rolls back the transaction, the activate/passivate calls
will not be rolled back. While the server may choose to passivate the
instance again (disconnecting it from your object), the instance will not be
re-connected (re-activated) to the previous object. In other words, the spec
implies that the state of the server and the instance pool itself is not
transacted while clients are making transacted calls on beans.

It also means that if you made any database calls in either activate or
passivate (which you are not supposed to), the effects of these calls will
not be undone when the transaction is rolled back.

Hope this helps,

Imre Kifor
Valto Systems

-----Original Message-----
From: Richard Monson-Haefel <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Saturday, February 27, 1999 9:29 AM
Subject: Activation and Transaction in Entity beans


>In section 9.4.1 of the EJB specification.  When talking about Entity
>beans and the ejbPassivate and ejbActivate methods it states "This
>method executes in an unspecified transaction context."   Can someone
>tell me what that means?  Does it mean that its not specified by the EJB
>whether an entity bean can be passivated and activated within a
>transaction?
>
>--
>Richard Monson-Haefel
>Senior Consultant
>BORN Information Services
>
>===========================================================================
>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".

Reply via email to