Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2115

Document how the hibernate session is implemented

    XMLWordPrintableJSON

Details

    Description

      There have been many questions on the user's list about how the hibernate session is implemented in tapestry-hibernate and also how to use tapestry-hibernate outside of a tapestry managed request / response.

      I think that the documentation should mention the following:
      1. The hibernate session service provided by tapestry-hibernate is a singleton
      2. The singleton is a proxy that points to a per-thread, lazy loaded hibernate session instance
      3. The per-thread session instance is cleaned up by Registry.cleanupThread() /
      PerThreadManager.cleanup()
      4. Tapestry automatically cleans up the thread local inside the normal request / response flow
      5. Outside of a tapestry managed request / response, you must explicitly cleanup the thread
      6. Transaction management outside of a request/response flow
      a. @CommitAfter and @Match("*DAO") with HibernateTransactionAdvisor
      b. HibernateSessionManager.commit() and abort()
      c. session.getTransaction().commit()

      Attachments

        Activity

          People

            kaosko Kalle Korhonen
            uklance Lance S
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: