Announcement Announcement Module
Collapse
No announcement yet.
How to intercept transaction proxy exceptions? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 {

    @NotNull
    private String name;

    @NotNull
    private String surname;

    ...
    }

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

    @Transactional
    void updateUser(User user) {
    userDao.updateUser(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!
Working...
X