• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why can't I catch this EJBTransactionRolledbackException  RSS feed

Tshegofatso Manakana
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server: WildFly10 JPA with eclipseLink 2.6.3-M1 JavaEE7

I have the following EJB:

When I call doSomething() this is what I see:
First off go and fetch an instance of tws14 from the db
Found instance of tws14: za.co.fnds.persistence.entities.Tws14WSBatchChRequests[ batchChRequestId=103 ] 2.1 CARD PLASTIC : NBCRFLI_PIN
Now call a method that throws the EJBTrxnRollBackException....
Set some invalid values on tws14 in an attempt to get exception thrown...

---> This line should not be logged if exception was thrown....
Finally trying to get a fresh instance from the db again...
Was able to get instance from db: za.co.fnds.persistence.entities.Tws14WSBatchChRequests[ batchChRequestId=103 ]
Try and update the instance of tws again...
Could update the instance without problems.....
Check the OrderCards value:

My question is: Why is the program not going into the catch clause because my logs indicates that a javax.validation.ConstraintViolationException was thrown. Why is the bold log above still show? What am I missing? Is there a way I'm supposed to be handling this program structure in an EJB?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!