Vita Rara: A Life Uncommon

JPA Open Session in View

Hi Li,

I haven't used the OpenEntityManagerInViewInterceptor yet. In general I have shied away from using the open session in view methodology in my development.

With that said I did accidentally create an open entity manager in the view. I used the EntityManagerFactory to make an EntityManager in a DAO. This new em was not tied to the transaction, and stayed open all the way through the view layer. It really confused me. That was when I figured out how to get a transactional em in my DAO's, Getting a Transactional EntityManager in a JpaDaoSupport Derived DAO.

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
  • Allowed HTML tags: <a> <img> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <h1> <h2> <h3>
  • Lines and paragraphs break automatically.
More information about formatting options