Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-954

Ensure segregation of deployments in the 2nd level cache

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • AS 4.2.0 GA
    • AS 4.2.0 GA
    • Clustering
    • None
    • Documentation (Ref Guide, User Guide, etc.)

      The JBoss Cache used for the clustered EJB3 entity 2nd level cache is shared across deployments. As a result it is possible that different deployments will deploy the same classes, in which case the contents of the bean caches will be mixed and cached queries that don't specify a region will be mixed in the default region. In the case of bean caching, this can lead to

      1) classloader issues where the JGroups up_thread can't determine the correct classloader to use to deserialize replication messagaes
      2) the cache region that is inadvertently being shared can be inactivated if one of the deployments is undeployed.
      3) Inability to replicate the default query cache region due to potential classloader problems a la #1 above.

      These issues can be avoided if a unique hibernate.cache.region_prefix is provided for each deployment. The provided prefix should be used as the first level of FQNs in the cache. If the user doesn't specify this property, the EJB3 deployer should create one from the name of the deployment package + the persistence unit name.

      If the EJB3 deployer creates the region_prefix, it should replace any '.' (e.g. xyz.jar) with an '_'. Otherwise org.hibernate.cache.TreeCache will convert the '.' to '/' and that will then become a level in the FQN.

            bstansbe@redhat.com Brian Stansberry
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: