Announcement Announcement Module
No announcement yet.
How to intercept transaction proxy exceptions? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to intercept transaction proxy exceptions?

    Hi all guys,
    I'm fighting with the following problem.
    I'm using Hibernate Validators to validate my beans, just before they are updated on the database to prevent sql constraint exceptions.

    class User {

    private String name;

    private String surname;


    In my service layer I use @Transactional annotation in the following way:

    void updateUser(User user) {

    and the class is also exposed as a CXF web service.
    The problem is that the Hibernate validator exceptions are thrown in the Transaction Proxy (when the transaction is committed I think) and I can't catch those exceptions (they are thrown directly from the web service).

    Is there any transaction exception handler that I can configure?
    Do you have any advice about proxy exceptions handling?

    Thanks in advance for help!