2 Replies Latest reply on Sep 7, 2010 12:19 PM by navssurtani

    Infinispan-Query can't work in Infinispan Distribution Mode (2)

    liliyancn

      When Infinispan works in LOCAL, r, i mode, the default interceptors are :

       

      org.infinispan.interceptors.InvocationContextInterceptor
      org.infinispan.interceptors.TxInterceptor
      org.infinispan.interceptors.MarshalledValueInterceptor
      org.infinispan.interceptors.NotificationInterceptor
      org.infinispan.interceptors.LockingInterceptor
      org.infinispan.interceptors.ReplicationInterceptor
      org.infinispan.interceptors.CallInterceptor

       

      But when works in d mode, the default interceptors are :

       

      org.infinispan.interceptors.InvocationContextInterceptor

      org.infinispan.interceptors.DistTxInterceptor
      org.infinispan.interceptors.MarshalledValueInterceptor
      org.infinispan.interceptors.NotificationInterceptor
      org.infinispan.interceptors.DistLockingInterceptor
      org.infinispan.interceptors.DistributionInterceptor
      org.infinispan.interceptors.CallInterceptor

       

      Check infinispan-query 4.1.0.CR3 source code, the QueryHelper.java :

       

      private void initComponents(Class<? extends QueryInterceptor> interceptorClass)
               throws IllegalAccessException, InstantiationException
      {

            // get the component registry and then register the searchFactory.

            ComponentRegistry cr = cache.getAdvancedCache().getComponentRegistry();
            cr.registerComponent(searchFactory, SearchFactoryImplementor.class);

       

            // Get the interceptor chain factory so I can create my interceptor.
            InterceptorChainFactory icf = cr.getComponent(InterceptorChainFactory.class);

       

            CommandInterceptor inter = icf.createInterceptor(interceptorClass);
            cr.registerComponent(inter, QueryInterceptor.class);

       

            cache.getAdvancedCache().addInterceptorAfter(inter, LockingInterceptor.class);

      }

       

      It only tries to hook its QueryInterceptor after LockingInterceptor, but it can't work under d mode, cause infinispan uses DistLockingInterceptor.

       

      Please see http://community.jboss.org/thread/155819, for unit test fails.