3 Replies Latest reply: Mar 27, 2012 7:51 AM by Galder Zamarreño RSS

    Can not remove entry?

    zhang ni Newbie

      My infinispan version is 5.1.3CR1.

      When I enforce continous put、remove and get operation, the data been put can't be removed.

       

      My code:

                EmbeddedCacheManager manager;

              try

              {

                  manager = new DefaultCacheManager("infinispan-distribution1.xml");

              }

              catch (IOException e)

              {

                  throw new RuntimeException(e);

              }

              //abstractClient = manager.getCache("needpersistence1");

              //byteClient = manager.getCache("needpersistence1");

              Cache<String, Item>  client = manager.getCache("needpersistence1");

             

              int count = 100;

              while (count > 0)

              {

                  Item value = new Item();

                  value.aa="aa";

                  value.bb="bb";

                  final String key = count + "SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#";

                  try

                  {

                      client.put( key, value);

                       try

                       {

                           Item aa = client.remove(key);

                           //System.out.println(aa);

      //                     abstractClient.remove(key);

                       }

                       catch (Exception e)

                       {

                           LOGGER.error("",e);

                           throw new IllegalStateException("Storage put, the version conflict");

                       }

                      

                       Item obj = client.get(key);

                       if(obj != null)

                       {

                           System.out.println("key=" + key);

                           System.out.println("can not delte:"+key+":"+obj);

                       }

                     

                      /*Thread thread = new Thread()

                      {

                          public void run()

                          {

                            

                                  store.delete(key);

                                  System.out.println(store.get( key));

                            

                          };

                      };

                     

                      thread.start();*/

                  }

                  catch (Exception e)

                  {

                     

                  }

                 

                  count--;

              }

       

      My XML configuration file:

      <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"

         xmlns="urn:infinispan:config:5.1">

       

         <global>

             <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport">

              <properties>

                   <property name="configurationFile" value="jgroups.xml"/>

              </properties>

            </transport>

            <serialization marshallerClass="org.infinispan.marshall.VersionAwareMarshaller"/>

         </global>

        

         <default>

            <!-- Configure a synchronous replication cache -->

            <clustering mode="distribution">

               <sync/>

               <hash numOwners="1"/>

            </clustering>

           

            <eviction maxEntries="50" strategy="LRU"/>

      <!--

            <indexing enabled="true" indexLocalOnly="true">

               <properties>

                  <property name="hibernate.search.default.directory_provider" value="ram" />

               </properties>

            </indexing>

      -->      

         </default>

        

         <namedCache name="nopersistence">

         </namedCache>

         <namedCache name="needpersistence1">

         <loaders passivation="true" shared="true" preload="true">

         <!-- We can have multiple cache loaders, which get chained -->

         <loader class="org.infinispan.loaders.file.FileCacheStore"

                 fetchPersistentState="true"

                 purgerThreads="5"

                 purgeSynchronously="true"

                 ignoreModifications="false"

                 purgeOnStartup="false">

            <!-- See the documentation for more configuration examples and flags. -->

            <properties>

               <property name="location" value="d://user"/>

              

            </properties>    

            <!--

            <async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/> -->

            <async enabled="false"/>

         </loader>     

      </loaders>

         </namedCache>

        

      </infinispan>

       

      The output:

      key=99SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:99SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=95SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:95SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=93SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:93SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=90SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:90SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=89SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:89SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=81SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:81SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=80SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:80SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=78SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:78SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=77SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:77SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=76SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:76SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=73SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:73SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=72SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:72SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=69SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:69SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=68SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:68SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=65SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:65SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=64SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:64SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=62SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:62SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=61SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:61SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=59SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:59SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=58SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:58SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=57SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:57SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=56SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:56SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=54SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:54SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=51SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:51SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=49SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:49SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=48SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:48SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=46SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:46SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=44SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:44SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=43SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:43SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=42SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:42SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=41SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:41SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=39SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:39SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=34SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:34SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=25SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:25SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null

      key=9SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#

      can not delte:9SDB#ITEMS#AKIAI5ECPCPFRDE4Q2UQ#SDBTESTER_DOMAIN_20111216_V0#:null @ null