0 Replies Latest reply on Jul 21, 2006 3:20 AM by Wolfgang Buckel

    Problem disabling Hibernate SecondLevelCache with HibernateM

    Wolfgang Buckel Newbie

      For testing pruposes I tried to disable the SecondLevelCache via the MBean property "SecondLevelCacheEnabled" but I did not work:

       <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=ConfigHibernate">
       <attribute name="DatasourceName">java:ConfigV3DS</attribute>
       <attribute name="Dialect">org.hibernate.dialect.PostgreSQLDialect</attribute>
       <attribute name="SessionFactoryName">java:/hibernate/ConfigV3SessionFactory</attribute>
       <attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
       <attribute name="Hbm2ddlAuto">update</attribute>
       <attribute name="ShowSqlEnabled">true</attribute>
       <attribute name="SecondLevelCacheEnabled">false</attribute>
       <attribute name="StatGenerationEnabled">true</attribute>
       </mbean>
      


      Hibernate still says
      2006-07-20 17:50:29,535 INFO [org.hibernate.cfg.SettingsFactory] Second-level cache: enabled

      when my HAR deploys.

      I checked the sources of JBoss 4.0.4.GA (which is what I use). In org.jboss.hibernate.jmx.Hibernate.java I couldn't find any line of code where the property "secondLevelCacheEnabled" would be forwarded to Hibernate. The method "transferSettings()" just doesn't do it as with the other properties. Is this a bug?

      Any help or workarounds would be appreciated.
      Thanks,
      Wolfgang