A stateful session bean instance may, but is not required to, commit a started transaction before a business method returns. If a transaction has not been completed by the end of a business method, the container retains the association between the transaction and the instance across multiple client calls until the instance eventually completes the transaction.
when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
SCBCD 1.3: 94%<br />SCWCD 1.4: 91%<br />SCJP 5: 95%
Originally posted by warren li:
No. You'll get an IllegalStateException.
You have to end a transaction before you start a new one. EJB 2.0 doesn't support nested transactions.
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%
/** Code speaks louder than words */
1. If Bean2 does not do commit then?
2. If Bean2 calls CMT which is of a stateful session bean that does not do commit immediately then?
Assume i hava a stateful session bean.
i have started a transaction by issuing userTransaction.begin() inside method A and it returns without commiting it.And the client now calls the method B which is again invoking the userTransaction.begin().
what will happen?.
/** Code speaks louder than words */
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%
For clarification, an EJB that
declares its transactional behavior with RequiresNew called within another transaction
is not an example of nested transactions. The containing transaction is suspended
while the new one executes, and resumes when the new transaction
completes. The �inside� transaction does not affect the first transaction. For EJBs,
transactions are either suspended or propagated.
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|