posted 16 years ago
Hi,
In first case, the method B is not in transaction and if it throws system exception, It won't effect the methods A transaction. Hence, the transaction continues.This means, Transaction can be committed irrespective of the exception thrown in method B.
In second case, method B and Method A both are in the same transaction. If Method B throws system exception, then the transaction of a would get effected. Here, the transaction 'can be' rolled back as both methods are in the same transaction.
In any case, the bean instance won't get effected. Might be the question is wrong. the transaction gets effected not the bean instance.
Please correct me if I am wrong.
Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0