Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-4244

Hibernate deployer not up to date with respect to Hibernate config changes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • EAP_EWP 5.1.0
    • EAP 5.0.0, EAP 5.0.1
    • System
    • None
    • Documentation (Ref Guide, User Guide, etc.), Release Notes, Compatibility/Configuration

    Description

      (EAP equivalent to JBAS-7411)

      The mechanism for parsing and deploying a hibernate.cfg.xml file is overly fragile and prone to falling out of date with respect to configuration options that Hibernate supports. See http://stackoverflow.com/questions/1443192/jbosscache-as-a-second-level-cache-for-hibernate-in-jboss-5/ for an example of how this has broken.

      There's a deployer that parses a hibernate.cfg.xml into a metadata object, which includes the set of configuration properties stored as a key/value pairs. But the property names you use have to map to properties on the org.jboss.hibernate.jmx.Hibernate class, because the deployer uses JBoss MC property injection to populate the o.j.h.jmx.Hibernate object. So you can't use the regular Hibernate property names, which include '.' and such. Plus it breaks when Hibernate adds a new property, a la what this user is seeing.

      In its start() method the org.jboss.hibernate.jmx.Hibernate class then builds a Hibernate Configuration object, by mapping it's property values back to the standard Hibernate configuration property names.

      Fix is to inject into the o.j.h.jmx.Hibernate object the original set of parsed key/value pairs via a new setProperties(Set<BaseNamedElement>) method. The start() method then builds the Configuration from that set of properties. This allows any valid Hibernate property to be used and removes the need to use AS-specific property names. The Hibernate MBean interface then just expose whatever properties we've chosen to map.

      The fix of course also supports the legacy AS-specific property names.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: