Hi,
Muhammad Farhat Kaleem a �crit :
> Hi,
> I have a question with regard to the Tx attributes. The situation is like :
> there is a session bean with a method A (Tx attribute = Required) that
> 1) invokes a method on an entity bean(Tx attribute= Required)
> 2) invokes a method on another session bean (Tx attribute=Never) which then
> further invokes a method on an entity bean.
>
> now if the session bean in 2) has Tx attribute Required, method A completes
> normally, and the Tx associated with this method either commits or rolls back,
> but if the session bean in 2) has Tx attribute Never, then a RemoteException is
> thrown, as should happen........but the part in 1) completes, so that the change
> there is reflected in the database...........
I think the change is not reflected in the database since the transaction associated
with 1) is the same as the one associated with method A (the Tx attribute is
TX_REQUIRED, not TX_REQUIRE_NEW...). Since that transaction rolls back, the database
does not keep the changes.
If you have an example that shows what you describe, you should ask an explanation
to the support for your server.
Benjamin
>
> so my question is that shouldnt the Tx of method A be rolled back as a whole, if
> there is a RemoteException in part 2, or is the container just required to throw
> a RemoteException and not roll back the whole Tx...........this I would like to
> be explained since if the Tx attribute is Required in 2), then in case of a
> problem in part 2) the Tx of method A is treated as a whole and rolled back, and
> the changes made in part 1) are not written to the database..............
> any explanation would be appreciated..........
> regards,
> farhat..........
>
> ===========================================================================
> 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".