Page 1 of 1

About Question enthuware.oce-ejbd.v6.2.459 :

Posted: Sun Dec 02, 2012 3:55 am
by rkbansal83
Question should clear if we are using CMT or BMT MDB(transaction demaraction )

Because if we are using CMT MDB with Transaction attribute NOT_SUPPORTED , then roll back scenario goes out of picture.
Similary if we are using BMT MDB, then we might have a scenario in which RunTimeException takes place after ut.commit code is executed.

Code: Select all

method()
{
....
ut.start() //ut is UserTransaction instance
//Some lines of code
ut.commit()
//some lines of code
//run time exception takes place here

}
in the above case transaction is already commited and RunTimeException takes place afterwards.
Dont you think , transaction rollback will not take place ?

Re: About Question enthuware.oce-ejbd.v6.2.459 :

Posted: Sun Dec 02, 2012 7:39 am
by admin
Well, when the statement says, "the transaction is rolled back", that implies a transaction exists at that point. In your example, that is not the case.

This question does not specify CMT or BMT on purpose because the answer does not really depend on which type of transaction management is used.

HTH,
Paul.