1 Reply Latest reply on May 23, 2008 10:02 AM by Tom Goring

    Hibernate 2nd lvl cache in seam

    Anatorian Su Newbie

      Who know what the default second level cache implementation of the seam's hibernate? How to use treecache as hibernate's second level cache?

        • 1. Re: Hibernate 2nd lvl cache in seam
          Tom Goring Apprentice

          It depend what you define in persistence.xml.


          There are example on the net of how to do this.



          <?xml version="1.0" encoding="UTF-8"?>
          <!-- Persistence deployment descriptor for dev profile -->
          <persistence xmlns="http://java.sun.com/xml/ns/persistence"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
               version="1.0">
          
               <persistence-unit name="S2JNET">
                    <provider>org.hibernate.ejb.HibernatePersistence</provider>
                    <jta-data-source>java:/S2JNETDatasource</jta-data-source>
                    <properties>
                         <property name="hibernate.dialect"
                              value="org.hibernate.dialect.MySQLDialect" />
                         <property name="hibernate.hbm2ddl.auto" value="update" />
          <!--                <property name="hibernate.hbm2ddl.auto" value="update" /> -->
                         <property name="hibernate.show_sql" value="true" />
                         <property name="hibernate.format_sql" value="true" />
                         <property name="hibernate.cache.use_query_cache" value="true" />
                         <property name="hibernate.use_identifier_rollback" value="true" />
                         <property name="hibernate.cache.provider_class"
                              value="org.jboss.ejb3.entity.TreeCacheProviderHook" />
                         <property name="hibernate.treecache.mbean.object_name"
                              value="jboss.cache:service=EJB3EntityTreeCache" />
                         <property name="jboss.entity.manager.factory.jndi.name"
                              value="java:/S2JNETEntityManagerFactory" />
                    </properties>
               </persistence-unit>
          
          </persistence>