JPAContainer, Hibernate and commit exceptions

Hello, I’m trying to use the “entity manager per request” pattern, as implemented in

So :

  • I set up the

  • I setup my JPAContainer using :
    [font=Courier New]

    LazyHibernateEntityManagerProvider entityManagerProvider = new LazyHibernateEntityManagerProvider();
    container.getEntityProvider().setLazyLoadingDelegate(new HibernateLazyLoadingDelegate());


  • I setup a Component (e.g. Table) to use the container

when trying to commit :
I’d like to catch exceptions (such as

But it appears that exceptions are actually thrown in the servlet filter, and even there I cannot catch them properly.

So, what is the correct pattern to catch exceptions using JPAContainer with Hibernate ?

Thanks for your help

Sorry, my mistake, obviously a try/catch around the commit() is not enough, you have to set up an ErrorHandler…