> I have two session beans, SessionBean1 and SessionBean2.
> SessionBean1(SB1) is configured with CMT with transaction attribute
> Required and SessionBean2(SB2) with BMT. So, each business method
> of SB1 executes with a transaction context.
> So, my question is, from a business method of SB1, if I call a business
> method of SB2:
> * Does the transaction context of SB1 get carried to the business method
> of SB2?

No. Refer to section 17.6.1 of EJB2.0 specs - it clearly indicates that when
a client (SB1 in your case) invokes a business method on a bean with bean
managed transaction, the container suspends any transaction that may be
associated with the client request prior to invoking the bean method.

> * If not, then do I have to call userTransaction.begin() and
userTransaction.commit() in SB2's business method?

Yes.

> If so, then this seems to negate what  is said in the EJB2.0 spec sec
17.1.2(about nested transactions).

No - this is not a case of nested transactions. Nested transactions occur
when you can start (i.e. nest) a transaction within an existing transaction.
In the scenario described above, you are always dealing with flat
transactions (as mandated by the current EJB specs) - the container suspends
an existing transaction prior to invoking the method in SB2.

-Saurabh

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