Announcement Announcement Module
No announcement yet.
TreeCache + Hibernate + Spring + Tomcat Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • TreeCache + Hibernate + Spring + Tomcat


    Can I use Spring/Hibernate transaction with Treecache or do I have to use JTOM?


  • #2
    There seems to be conflicting documentation.

    There's threads on that and and a FAQ here - which states "it can also run under a standalone Java process (i.e., outside J2EE context)".

    Hibernate reference docs states "JBoss TreeCache. Such a cache may only be used in a JTA environment".
    Last edited by robyn; May 16th, 2006, 04:22 AM.


    • #3
      Spring, Hibernate Treecache and Tomcat

      Hello there,

      I have a JSF web application running in an active-active windows server cluster currently using Hibernate 3.2.3ga. The application is deployed on Tomcat 5.5.9. I now want to introduce Hibernate's second level caching using the JBoss TreeCacheProvider so that I can take advantage of the available cluster cache invalidation facilities.

      Can anybody tell me if this is achievable at all, and if so how I should configure my applicationContext.xml file?

      Thanks in advance, Carl


      • #4
        Configuring caching with Hibernate should be roughly the same for any of the providers (it's just then a question of configuring the actual cache). I would do a search, there are lots of articles regarding turning on caching including the Hibernate reference manual.


        • #5
          Yes, i've implemented jboss cache in my application. It's working fine.
          Do let me know if you need something.

          Hibernate reference docs states "JBoss TreeCache. Such a cache may only be used in a JTA environment".

          Correct only because Jboss cache is a transactional cache


          • #6
            Thanks v much... it's the 'Such a cache may only be used in a JTA environment and you must specify hibernate.transaction.manager_lookup_class.' bit that's confusing me (I'm pretty new to the whole Java/Hibernate/Spring world having come from a .NET background).

            From my limited understanding I think that the Tomcat services don't constitute a JTA environment - is that right? If so does that mean I simply cannot use the Treecache system? If not, and if I can use this system, which settings should I be using for the 'hibernate.transaction.manager_lookup_class' property and are there any other properties that I will need to set up in the applicationContext.xml file?

            I've had a play with the SwarmCacheProvider, which may well be suitable for our needs but would appreciate any further enlightenment on the subject would be appreciated!

            Many thanks, Carl