0 Replies Latest reply on May 22, 2006 9:07 AM by Wolf-Dieter Fink

    EntityBean locking (pessimistic) in a cluster

    Wolf-Dieter Fink Master

      Hi,
      I have a problem with the pessimistic locking in a JBoss-cluster, a CMP-Entity is not locked if it runs on a different node.
      Here the szenario:

      one SessionBean control the Entity (SessionFascade), do an Entity.setXX() something other stuff.

      run the same SessionBean call at 3clients (2 active JBoss nodes in the cluster)

      The first setXX() at node A works
      the second setXX() at node B works (why this, IMO has to wait for node A)?
      the third setXX() again at node A waits until the first SessionBean ends with commit

      If I run without clustering the behavior is IMO correct the second call is waiting until the first call commits.
      In a cluster this works only local at each node!?


      I think it's a missconfiguration, here is my bean configuration of standardjboss.xml which is used:

      <container-configuration>
       <container-name>Clustered CMP 2.x EntityBean</container-name>
       <call-logging>false</call-logging>
       <invoker-proxy-binding-name>clustered-entity-rmi-invoker</invoker-proxy-binding-name>
       <sync-on-commit-only>false</sync-on-commit-only>
       <insert-after-ejb-post-create>false</insert-after-ejb-post-create>
       <container-interceptors>
       <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
       <interceptor>org.jboss.ejb.plugins.CleanShutdownInterceptor</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.CallValidationInterceptor</interceptor>
       <interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</interceptor>
       <interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</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>
       <!-- ORGA modification to enable Cache Invalidation -->
       <interceptor>org.jboss.cache.invalidation.triggers.EntityBeanCacheBatchInvalidatorInterceptor</interceptor>
       <interceptor>org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor</interceptor>
       </container-interceptors>
       <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
       <!-- ORGA modification to enable Cache Invalidation -->
       <instance-cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</instance-cache>
       <persistence-manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</persistence-manager>
       <locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
       <container-cache-conf>
       <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
       <cache-policy-conf>
       <min-capacity>50</min-capacity>
       <max-capacity>1000000</max-capacity>
       <overager-period>300</overager-period>
       <max-bean-age>600</max-bean-age>
       <resizer-period>400</resizer-period>
       <max-cache-miss-period>60</max-cache-miss-period>
       <min-cache-miss-period>1</min-cache-miss-period>
       <cache-load-factor>0.75</cache-load-factor>
       </cache-policy-conf>
       </container-cache-conf>
       <container-pool-conf>
       <MaximumSize>100</MaximumSize>
       </container-pool-conf>
       <commit-option>A</commit-option>
       <cluster-config>
       <partition-name>${jboss.partition.name:DefaultPartition}</partition-name>
       </cluster-config>
       </container-configuration>


      thanks for reply
      Wolf