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

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.

Moderators: Site Manager, fjwalraven

Post Reply
PedroKowalski
Posts: 25
Joined: Thu Aug 04, 2011 10:36 am
Contact:

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

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

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

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

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

Guest

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

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

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

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

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests