4 Replies Latest reply on Mar 1, 2006 4:06 PM by jason1

    JBoss 3.2.6 and the new cmp2.x jdbc2 pm caching mechanism in

    rcostanzo

      Hi,

      I am in the process of upgrading to JBoss 3.2.6 and noticed the new cmp2.x jdbc2 pm caching mechanism. If I could use this for my application, it would greatly help with deadlock/slow locking situations which arise from the pessimistic locking.

      My application uses a cluster of servers, and I saw no mention as to whether or not cache invalidation is supported in conjunction with this new caching mechanism. Does anybody know? If so, do you mind posting a sample standardjboss.xml section for cmp2.x jdbc2 pm with cache invalidation. Thanks!

      -Rob

        • 1. Re: JBoss 3.2.6 and the new cmp2.x jdbc2 pm caching mechanis
          rcostanzo

          Figured it out:

           <container-configuration>
           <!--
           | This is like standard IPT but with global (cross-transactional) row cache behind,
           | i.e. no locking in EJB layer + global persistence data cache
           -->
           <container-name>cmp2.x jdbc2 pm with cache invalidation</container-name>
           <call-logging>false</call-logging>
           <invoker-proxy-binding-name>entity-rmi-invoker</invoker-proxy-binding-name>
           <sync-on-commit-only>false</sync-on-commit-only>
           <insert-after-ejb-post-create>true</insert-after-ejb-post-create>
           <call-ejb-store-on-clean>true</call-ejb-store-on-clean>
           <container-interceptors>
           <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
           <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
           <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
           <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
           <interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</interceptor>
           <interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
           <interceptor>org.jboss.ejb.plugins.EntityReentranceInterceptor</interceptor>
           <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
           <interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
           <interceptor>org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor</interceptor>
           <interceptor>org.jboss.ejb.plugins.cmp.jdbc2.RelationInterceptor</interceptor>
           </container-interceptors>
           <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
           <instance-cache>org.jboss.ejb.plugins.PerTxEntityInstanceCache</instance-cache>
           <persistence-manager>org.jboss.ejb.plugins.cmp.jdbc2.JDBCStoreManager2</persistence-manager>
           <locking-policy>org.jboss.ejb.plugins.lock.NoLock</locking-policy>
           <container-cache-conf>
           <cache-policy-conf>
           <min-capacity>500</min-capacity>
           <max-capacity>10000</max-capacity>
           </cache-policy-conf>
           <cache-policy-conf-other>
           <partitions>10</partitions>
           <!-- uncomment to use JDBC java.sql.Statement.executeBatch()
           <batch-commit-strategy/>
           -->
           <invalidable/>
           </cache-policy-conf-other>
           </container-cache-conf>
           <container-pool-conf>
           <MaximumSize>100</MaximumSize>
           </container-pool-conf>
           <commit-option>C</commit-option> <!-- don't change, irrelevant, use container-cache-conf -->
           </container-configuration>
          


          • 2. Re: JBoss 3.2.6 and the new cmp2.x jdbc2 pm caching mechanis

            Hi!

            Just to clarify, this does not use :

            <instance-cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</instance-cache>

            Does the cmp2.x jdbc2 pm caching mechanism already take care of this for us?

            • 3. Re: JBoss 3.2.6 and the new cmp2.x jdbc2 pm caching mechanis
              rcostanzo

              Yes, the common layer of the cache (not the per tx layer) properly handles flushing when receiving invalidation events. The per tx layer doesn't need to invalidate since it only lives for the length of the current transaction.

              • 4. Re: JBoss 3.2.6 and the new cmp2.x jdbc2 pm caching mechanis

                great. Thanks!