Hi!

Anil Lobo skrev:

> Hi,
>         I have a question on the EJB v 1.1 spec, on Container Managed
> Transaction attribute pg 180 in acrobat, section 11.6.2.2 Requires. It
> states that "The Container attempts to commit the transaction when the
> business method has completed. The container performs the commit protocol
> before the method result is sent to the client."
>
> My question is this:
>         If Session EJB A has a transaction attribute of REQUIRESNEW, calls a
> method on Entity EJB B which has a transaction attribute of REQUIRED, does
> the container commit just before the result is sent to the client (Session
> EJB A) ?

No, it will not perform a commit.

> If yes, what if A does a transaction rollback ? If the container
> does not commit , then why (according to the spec it should have commited.)?

It will not perform a commit since it will do it when the method
_that_started_the_transaction_ ends. And it is the method in Session EJB A (with
REQUIRES_NEW attribute) that started the transaction. Entity EJB B (with
REQUIRED attribute) will be included into this tx and not start a new one. But,
if Entity EJB B would have REQUIRES_NEW than the tx from Session EJB A would be
halted, a new one would be started fo Entity EJB B and that would be commited
when Entity EJB B method is finished. Tx from Session EJB A would then be
continued when returned.

//Lennart
--
________________________________
Lennart Petersson
Benefit AB
Tyn�sgatan 14
S-652 24 Karlstad
Phone: +46 (0)54 177253
mailto:[EMAIL PROTECTED]
Yahoo! Messenger, my nickname is: en_grillad_special
http://www.benefit.se

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