6 Replies Latest reply on Mar 24, 2006 5:09 PM by bclements

    problem with JBossCache 1.2.3 with Hibernate 3.1

    bclements

      I'm trying to use hibernate 3.1 with JBCache 1.2.3.

      I keep getting this error:
      java.lang.UnsupportedOperationException: TreeCache is a fully transactional cache: MY_REGION
      java.lang.UnsupportedOperationException: TreeCache is a fully transactional cache: MY_REGION
      java.lang.UnsupportedOperationException: TreeCache is a fully transactional cache: MY_REGION
      at org.hibernate.cache.TreeCache.unlock(TreeCache.java:137)
      at org.hibernate.cache.ReadWriteCache.put(ReadWriteCache.java:176)
      at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:153)
      at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
      at org.hibernate.loader.Loader.doQuery(Loader.java:717)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
      at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
      at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
      at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)
      at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
      at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
      at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
      at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177)
      at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListene



      In my hibernate.cfg.xml I'm using

      org.hibernate.cache.TreeCacheProvider

      And my treecache looks like this:
      ------------------------------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>





      jboss:service=Naming
      jboss:service=TransactionManager

      org.jboss.cache.GenericTransactionManagerLookup
      REPEATABLE_READ
      REPL_ASYNC
      true
      0
      0

      true
      MOD-Catalog
      ...
      300000
      300000

      15000


      --------------------
      Any ideas?

      -Brian

        • 1. Re: problem with JBossCache 1.2.3 with Hibernate 3.1
          bclements

          Here is the treecache.xml again
          -------------------------------------

          <?xml version="1.0" encoding="UTF-8"?>





          jboss:service=Naming
          jboss:service=TransactionManager

          org.jboss.cache.GenericTransactionManagerLookup
          REPEATABLE_READ
          REPL_ASYNC
          true
          0
          0

          true
          MOD-Catalog
          ...
          300000
          300000

          15000

          • 2. Re: problem with JBossCache 1.2.3 with Hibernate 3.1
            bclements

            sorry...

            treecache.xml

            <?xml version="1.0" encoding="UTF-8"?>
            
            <server>
             <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
             <mbean code="org.jboss.cache.TreeCache"
             name="jboss.cache:service=TreeCache">
            
             <depends>jboss:service=Naming</depends>
             <depends>jboss:service=TransactionManager</depends>
            
             <attribute name="TransactionManagerLookupClass">org.jboss.cache.GenericTransactionManagerLookup</attribute>
             <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
             <attribute name="CacheMode">REPL_ASYNC</attribute>
             <attribute name="UseReplQueue">true</attribute>
             <attribute name="ReplQueueInterval">0</attribute>
             <attribute name="ReplQueueMaxElements">0</attribute>
            
             <attribute name="FetchStateOnStartup">true</attribute>
             <attribute name="ClusterName">MOD-Catalog</attribute>
             <attribute name="ClusterConfig">... </attribute>
             <attribute name="InitialStateRetrievalTimeout">300000</attribute>
             <attribute name="SyncReplTimeout">300000</attribute>
            
             <attribute name="LockAcquisitionTimeout">15000</attribute>
             </mbean>
            </server>
            


            • 3. Re: problem with JBossCache 1.2.3 with Hibernate 3.1
              manik

              what does your hibernate config look like?

              • 4. Re: problem with JBossCache 1.2.3 with Hibernate 3.1
                bclements

                Here is my hibernate.cfg.xml

                <?xml version='1.0' encoding='utf-8'?>
                <!DOCTYPE hibernate-configuration PUBLIC
                 "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                 "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
                
                <hibernate-configuration>
                 <session-factory>
                 <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
                 <property name="connection.url">jdbc:oracle:thin:@db:1521:DB</property>
                 <property name="connection.username">user</property>
                 <property name="connection.password">pw</property>
                 <property name="connection.pool_size">1</property>
                
                 <property name="current_session_context_class">thread</property>
                
                 <property name="dialect">org.hibernate.dialect.OracleDialect</property>
                
                 <property name="show_sql">true</property>
                
                 <property name="hibernate.cache.provider_class">org.hibernate.cache.TreeCacheProvider</property>
                
                 <property name="hibernate.generate_statistics">true</property>
                 <property name="hibernate.cache.use_structured_entries">true</property>
                 <mapping resource="Category.hbm.xml"/>
                
                 </session-factory>
                
                </hibernate-configuration>
                


                • 5. Re: problem with JBossCache 1.2.3 with Hibernate 3.1
                  manik

                  And what abt your hbm.xml file? Basically, do you set you rcache mode to transactional?

                  See http://www.hibernate.org/hib_docs/v3/reference/en/html/performance.html#performance-cache-transactional

                  • 6. Re: problem with JBossCache 1.2.3 with Hibernate 3.1
                    bclements

                    That was the problem. My cache usage was set to "read-write", not "transactional"

                    Thank you greatly for your help!!!!!!!

                    Brian