Try to catch just Exception, not TransactionRolledbackException. It might come wrapped
into some JBoss exception.
View the original post :
http://www.jboss.org/index.html?module=bbop=viewtopicp=3841485#3841485
Reply to the post :
This is the calling code:
| protected final ActionForward executeSave(ActionMapping mapping, BaseCRUDForm
form, HttpServletRequest request, HttpServletResponse response) throws
CRUDBusinessAccessException {
| if (form.isNew()) {
| return
Show the code that calls updateArea method. updateArea will fail with rollback
exception, not that you will be able to catch it inside updateArea.
View the original post :
http://www.jboss.org/index.html?module=bbop=viewtopicp=3841036#3841036
Reply to the post :
It is still not working with the RequiresNew...
Here's the relevant code (for another bean called Area instead of country):
updateArea method on a session bean:
/**
| *
| * @param value
| *
| * @ejb.interface-method
| * view-type = both
You could updateCountry in RequiresNew and catch the exception.
View the original post :
http://www.jboss.org/index.html?module=bbop=viewtopicp=3840844#3840844
Reply to the post :
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3840844
Could you check that the unique constraint is not being validated before the
insert/update?
View the original post :
http://www.jboss.org/index.html?module=bbop=viewtopicp=3840812#3840812
Reply to the post :
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=3840812
I could check that, however it will mean duplicating the unique constraints both on
the DB and on the business layer (Java), and I wanted to take advantage of the DB
checking of the contraints, and catching the exception.
Is that possible?
Thank you!
View the original post :