[infinispan-issues] [JBoss JIRA] (ISPN-9452) When fail-silently is false, the system will behave based on persistence configuration

Diego Lovison (JIRA) issues at jboss.org
Wed Aug 22 13:39:00 EDT 2018


Diego Lovison created ISPN-9452:
-----------------------------------

             Summary: When fail-silently is false, the system will behave based on persistence configuration
                 Key: ISPN-9452
                 URL: https://issues.jboss.org/browse/ISPN-9452
             Project: Infinispan
          Issue Type: Bug
            Reporter: Diego Lovison
            Priority: Critical


Using the configuration below when the store is not available, the system won't fail at the first time.

{code:xml}

<?xml version="1.0" ?>

<infinispan>
    <jgroups>
        <stack-file name="external-file" path="default-jgroups-tcp.xml"/>
    </jgroups>
    <cache-container name="myCacheContainer" default-cache="myCache" statistics="true">
        <transport cluster="WeatherApp" stack="external-file" />
        <distributed-cache owners="2" mode="SYNC" remote-timeout="15000" name="myCache">
            <transaction mode="NONE"/>
            <persistence connection-attempts="5" connection-interval="2000">
                <string-keyed-jdbc-store fetch-state="false" purge="false" read-only="false" shared="true">
                    <write-behind fail-silently="false" />
                    <string-keyed-table prefix="ISPN_STRING_TABLE" create-on-start="true">
                        <id-column name="ID_COLUMN" type="VARCHAR(255)"/>
                        <data-column name="DATA_COLUMN" type="BINARY"/>
                        <timestamp-column name="TIMESTAMP_COLUMN" type="BIGINT"/>
                    </string-keyed-table>
                    <connection-pool
                            connection-url="jdbc:h2:~/test;FILE_LOCK=SOCKET"
                            driver="org.h2.Driver" username="sa"/>
                </string-keyed-jdbc-store>
            </persistence>
        </distributed-cache>
    </cache-container>
</infinispan>
{code}

To reproduce the issue, you should start the application twice.
The first application will work fine. The second one will fail 5 times before stops working.
The fail-silently is "false" so it should fail at the first time.


{code:java}
public class ConfigurationFileCacheExample {

   public static void main(String[] args) throws InterruptedException, IOException {

      EmbeddedCacheManager cacheManager = new DefaultCacheManager("cache-jdbc-store.xml");
      try {
         Cache<String, LocationWeather> cache = cacheManager.getCache("weather");
         System.out.println(cache.size());
         while (true) {
            String location = UUID.randomUUID().toString();
            cache.put(location, new LocationWeather(37, location));
            TimeUnit.SECONDS.sleep(1);
         }
      } finally {
         cacheManager.stop();
      }
   }
}
{code}

 



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the infinispan-issues mailing list