3 Replies Latest reply on Aug 21, 2014 8:22 AM by wdfink

    Infinispan Oracle DB Cache Peristence Issue

    emilanca

      I am using the 6.0.0 Final of infinispan standalone and I have manually added a module where I configured the oracle JDBC driver. I then used the standalone.xml configuration to set the datasource and the persistent caches as such:

       

      <local-cache name="SampleCache" start="EAGER">

           <locking isolation="NONE" acquire-timeout="30000" concurrency-level="1000" striping="false"/>   

           <transaction mode="NONE"/>

           <binary-keyed-jdbc-store datasource="java:jboss/datasources/JdbcDS" passivation="true" preload="true" purge="false">                     

                              <binary-keyed-table prefix="IS6">

                                  <id-column name="id" type="VARCHAR2(500)"/>

                                  <data-column name="datum" type="BLOB"/>

                                  <timestamp-column name="version" type="NUMBER(19)"/>

                              </binary-keyed-table>                   

          </binary-keyed-jdbc-store>

        </local-cache>

       

       

      After I put values to the cache, the actual persistence is done at the infinispan server shutdown which seem to work. Data is also retrieved properly from the database and available in the memory after the infinispan server has been started.

      However if I try to remove an entry using the hotrod client and calling RemoteCacheManager.remove(key) AFTER all this has happened (data passed through the oracle DB) will not remove the entry at the first call. This method has to be called 2 times for the entry to be removed from the cache.

      Is there something wrong in my configuration or is this undesired behavior?

       

       

      NOTE: If I use a string keyed table in the standalone.xml I get a ClassCastException when trying to retrieve the keyset as well as other minor issues.

        • 1. Re: Infinispan Oracle DB Cache Peristence Issue
          prashant.thakur

          Hi Emil.

          We would like to have a write behind config with singleton store.

          Tried to do this but only either async or singleton is working at present

          Please let us know whether you have similar configuration.

          Can you please share the configuration details for persisting in Oracle DB ?

          Regards,

          Prashant

          • 2. Re: Re: Infinispan Oracle DB Cache Peristence Issue
            miha.sandor

            I am facing the same issue on Infinispan Server 6.0.2.Final. An entry will not remove from the Infinispan cache instance(after it has been restarted) unless RemoteCacheManager.remove(key) is invoked twice.

            Here is my configuration:

             

            <local-cache name="MyCache" start="EAGER">
                <locking isolation="NONE" acquire-timeout="30000" concurrency-level="1000" striping="false"/>         
                <transaction mode="NONE"/>   
                <binary-keyed-jdbc-store datasource="java:jboss/datasources/JdbcDS" passivation="true" preload="true" purge="false">     
                   <binary-keyed-table prefix="IS6">
                      <id-column name="id" type="VARCHAR2(500)"/>
                      <data-column name="datum" type="BLOB"/>
                      <timestamp-column name="version" type="NUMBER(19)"/>
                   </binary-keyed-table>                 
                </binary-keyed-jdbc-store>
            </local-cache>
            

             

            Datasource & driver:

             

            <datasources>
               <datasource jndi-name="java:jboss/datasources/JdbcDS" pool-name="JdbcDS" enabled="true" use-java-context="true">
                   <connection-url>jdbc:oracle:thin:@192.168.4.5:1521:orcl</connection-url>
                   <driver>oracle</driver> 
                   <security>
                      <user-name>MIHAELA_UTIL</user-name>
                      <password>paa</password>
                   </security>
               </datasource>
               <drivers>
                    <driver name="oracle" module="com.oracle">
                       <datasource-class>oracle.jdbc.OracleDriver</datasource-class>
                    </driver>
               </drivers>
             </datasources>
            

             

            Is this a bug in infinispan or is the oracle driver not supported? Thanks a lot for your help

            • 3. Re: Infinispan Oracle DB Cache Peristence Issue
              wdfink

              You might enable org.infinispan TRACE level logging to see whether the cache try to remove the value.

              Also you can set <datasource .... spy="true"> to enable the JDBC spy logging, you need to set jboss.jdbc.spy logging category to TRACE to see it in the logfile. This will show all JDBC commands.

               

              How do you access the data?

              Could you attach a simple app or show how to reproduce?

              Is it reproducable with Infinispan 7.0?