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

Moderator: admin

Post Reply
user

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

Post by user »

An uncaught exception may be an application exception as well
Is this because it can be an unchecked exception with @ApplicationException?

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

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

Post by admin »

Yes, that is correct.
If you like our products and services, please help us by posting your review here.

gurpreet_asrgndu
Posts: 55
Joined: Thu Jan 03, 2013 7:51 am
Contact:

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

Post by gurpreet_asrgndu »

the correct answer is given as
A message bean method begins a transaction but it (or any of its interceptor methods) does not commit the transaction before exiting from the method.

shouldn't here the transaction be specified as BMT, since if the transaction is CMT then the words " does not cmmit the transaction before exiting from the method " are meaningless because in CMT the transaction is committed once the method which began the transaction completes.

andreiribas
Posts: 5
Joined: Wed Jul 18, 2012 9:02 am
Contact:

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

Post by andreiribas »

I agree with gurpreet_asrgndu.

The last and supposedly correct answer is not clear if the MDB uses CMT or BMT.

If it uses CMT, then it won't need to explicitly commit the transaction because it's managed by the container.

I think this answer needs an update.

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

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

Post by admin »

As gurpreet_asrgndu says, it would be meaningless in case of a CMT. So if the statement says the bean does not commit the transaction before exiting from the method, then it has to be a BMT. It need not be said explicitly.
If you like our products and services, please help us by posting your review here.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh »

For option 1 : "A BMT stateful session bean method ..... without either committing.... the transaction".

If this bean never commits / rolls back the transaction, the container will rollback the transaction, log this as an application error to the system administrator, throw EJBException to the client.

johnlong
Posts: 197
Joined: Mon Jun 20, 2016 5:06 pm
Contact:

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

Post by johnlong »

Statement :
A message bean method begins a transaction but it (or any of its interceptor methods) does not commit the transaction before exiting from the method.

What if MDB is using BMT and rolls back transaction explicitly? In this case it is not container that rolled transaction back.

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

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

Post by admin »

If a transaction is already rolled back explicitly then there is no question of rolling back, right? The statement in the question is about when the contain must roll it back. Obviously, the transaction has to be active for a container to roll it back.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests