0 Replies Latest reply on Mar 5, 2007 5:42 AM by Xinhua Gu

    EJB3 2. level cache and query cache question

    Xinhua Gu Newbie

      Hi,
      i opened 2.level cache and query cache in persistence.xml like following:

      <property name="hibernate.show_sql" 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="hibernate.cache.use_query_cache" value="true" />


      and on an entity:
      @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)

      for 2. level cache

      and

      query.setParameter("vorname", vorname).setParameter("nachname",
       nachname).setMaxResults(maxResults).setFirstResult(firstResult)
       .setHint("org.hibernate.cacheable", new Boolean(true)).setHint("org.hibernate.cacheMode", CacheMode.GET ).setHint("org.hibernate.fetchSize", new Integer(100));
      

      for query cache...

      but it doese not work :(

      can anyone help?

      thanks in advance