Results 1 to 2 of 2

Thread: JPA Tx Flushed when Delegating to Hibernate

  1. #1
    Join Date
    Jul 2006
    Location
    London
    Posts
    500

    Default JPA Tx Flushed when Delegating to Hibernate

    I have an tx boundary method in a typical service which calls a dao to load an entity.

    The loading of the entity has to delegate to the underlying JPA implementation because of the filter feature not being in JPA.

    The problem is when delegating to the underlying implementation, after the finder the session is flushed and the changes seem to be committed.

    The default flush mode is AUTO - do I need to move to a manual flush mode or is this a problem with spring jpa support?

    Code:
    public Object doInJpa(EntityManager em) throws PersistenceException  {		
      Session session = (Session)em.getDelegate();	
      Filter filter = session.enableFilter("limitByStatus");				
      .
      .
    });
    Operations which do not delegate to the underlying do not flush as expected.
    Last edited by jamesclinton; Aug 17th, 2007 at 03:20 AM.
    Regards,
    James

  2. #2
    Join Date
    Jul 2006
    Location
    London
    Posts
    500

    Default Resolved

    Symptom but not cause!!

    Problem was due to (i think) incorrect transaction settings on tx boundary operation!.
    Regards,
    James

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •