SCJP, SCWCD, SCBCD, OCA J8
Originally posted by Keerthi P:
My understanding is that Scenario-2 will create nested transaction and the spec does not allow it.
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
A nested transaction occurs when a new transaction is started on a session that is already inside the scope of an existing transaction. The new, nested transaction is said to be nested within (or below the level of) the existing transaction. Changes made within the nested transaction are invisible to the top-level transaction until the nested transaction is committed. Even then, the changes are not visible outside the top-level transaction until that transaction is committed.
SCJP, SCWCD, SCBCD, OCA J8
Originally posted by Keerthi P:
That makes a lot of sense to me. Thanks Marco.
In case of the BMT scenario above, the existing transaction will be suspended and a new transaction is started when methodB() runs. So this is not a nested transaction.
[ August 11, 2004: Message edited by: Keerthi P ]
SCJP 1.4 / 5.0 - SCBCD 1.3 - SCWCD 1.4 - IBM 484
1) The domain for a transaction is a method, therefore unless in the same method you have more that one ut.begin() we cannot speak nested transactions;
That's why I'm saying if methodA and methodB were in the same bean (please read the original question),
that would be a nested transaction and the container will complain ...
BMT last paragraph of section 17.6.1, pg 357.
When an instance attempts to start a transaction using the begin() method of the javax.transaction.
UserTransaction interface while the instance has not committed the previous transaction,
the Container must throw the javax.transaction.NotSupportedException in the begin() method.
1) The domain for a transaction is a method, therefore unless in the same method you have more that one ut.begin() we cannot speak nested transactions;
Don't get me started about those stupid light bulbs. |