All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.
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?
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.
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.
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.