Page 1 of 1

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

Posted: Fri Aug 05, 2011 12:10 pm
by PedroKowalski
Howdy!

I've got a question to this explanation:
An application exception, unless having rollback attribute of @ApplicationException set to true, does not cause the container to rollback the transaction. Further, a non-runtime application exception cannot set this attribute because it does not use @ApplicationException annotation. This annotation is used only by subclasses of RuntimeException.
I don't remember such restriction. Do you mean I cannot say that my non-runtime Application Exception should i.e. rollback the transaction?
I can't use @ApplicationException on checked-exceptions?

Cheers!

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

Posted: Sun Aug 07, 2011 9:09 am
by admin
You are right. I couldn't find any such restriction for the application of @ApplicationException either. The explanation to the question has been updated accordingly.

Thanks for your feedback!

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

Posted: Wed Oct 03, 2012 1:10 am
by Guest
The situation in this question seems ambiguous to me: if there is not transaction before the bean call (so that required -> requires_new), upon getting a checked exception the container will try to _commit_ the transaction it created for the method. In any case, the caller will not be able to continue with "the same transaction". Unless we count the absence of transaction as a transaction, that is.

The intent of the question is clear, of course, but it doesn't look letter-perfect. Perhaps you'll want to change the method annotation to "mandatory", which will stipulate presence of the caller's existing transaction.

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

Posted: Fri Oct 05, 2012 5:33 pm
by admin
Guest wrote:The situation in this question seems ambiguous to me: if there is not transaction before the bean call (so that required -> requires_new), upon getting a checked exception the container will try to _commit_ the transaction it created for the method. In any case, the caller will not be able to continue with "the same transaction". Unless we count the absence of transaction as a transaction, that is.

The intent of the question is clear, of course, but it doesn't look letter-perfect. Perhaps you'll want to change the method annotation to "mandatory", which will stipulate presence of the caller's existing transaction.
I see what you are saying. It has now been changed to mandatory.

Thank you for your feedback!
Paul.