Using Hibernate Cache Module with HTTP Session Management Module

This section describes how to set up the Hibernate Cache module if you are also using the HTTP Session Management module.

If you have already configured your tc Server or Tomcat application server to use the HTTP Session Management Module, follow these steps to configure Hibernate module for your application:
  1. Install and configure the Hibernate Cache Module as described in Installing the Hibernate Cache Module and Setting Up the GemFire Hibernate Cache Module.
  2. Make sure that your Hibernate application is using the same GemFire topology as your application server.
  3. Include gemfire-modules-<version>.jar in your application .war file. This is typically done by putting the .jar file under the WEB-INF/lib directory.
    Note: Even though both modules include a gemfire-modules-<version>.jar file in their distribution, you only need to put one gemfire-modules-<version>.jar file in your .war file. It does not matter which one you use. You can even be using different versions of the HTTP Session Management and Hibernate Cache modules.
  4. Make sure that gemfire.jar is not included in your application .war file.
  5. Deploy your application .war file.
  6. These configuration steps will work with the default gemfire properties configurations that ship with the GemFire modules. If you have added or modified Gemfire properties for the HTTP Session Management Module (for example, as described inChanging vFabric GemFire Default Configuration (Tomcat) or Changing vFabric GemFire Default Configuration (tc Server)), then you must make the same changes for the Hibernate Cache module. See Changing vFabric GemFire Default Configuration (Hibernate Cache Module) for instructions on how to modify the default Hibernate Cache configuration.
Note: Using the Hibernate Cache Module with the HTTP Session Management Module creates a single GemFire cache in your application server. This cache will be shared by all applications deployed on the application server. Therefore, if two applications use the same entity objects (specified by fully qualified class names) or are configured to use the same cache region, all instances of these entities will end up in the single GemFire cache region. If this is not the desired behavior, then include gemfire.jar in the application war file. A GemFire cache will be created in the application's class loader.