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

Moderator: admin

Post Reply
rkbansal83
Posts: 33
Joined: Sat Nov 24, 2012 8:52 am
Contact:

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

Post 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 ?

admin
Site Admin
Posts: 10385
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests