3 Replies Latest reply on Apr 9, 2013 11:22 AM by dan.berindei

    Write Behind - regarding BLOB Data format

    bhahan

      Hello,

      I have created an error management component using Camel. The information available in the camel context (breadcrumbid, exchangeid, shortexchangeid,
      headerdetails, body etc) has to be put in the Infinispan remote clustered cache and the camel context information (in cache) asynchronoulsy persisted to Derby DB.

      This information available in the derby DB is being used by a third party application for displaying the data in the UI.

       

      Our config file is as follows,

       

      <loaders>
         <loader class="org.infinispan.loaders.remote.RemoteCacheStore" fetchPersistentState="true" ignoreModifications="false" purgeOnStartup="false">
           <properties>
            <property name="hotRodClientPropertiesFile" value="hotrod-client.properties"/>
            <property name="useDefaultRemoteCache" value="true"/>
           </properties>
          </loader>
          <loader  class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
             <properties>
           <property name="stringsTableNamePrefix" value="ISPN_STRING_TABLE"/>    
            <property name="idColumnName" value="ID_COLUMN"/>
            <property name="dataColumnName" value="DATA_COLUMN"/>
            <property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>
            <property name="timestampColumnType" value="BIGINT"/>
            <property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>
            <property name="connectionUrl" value="jdbc:derby://localhost:1527/MyDbTest;create=true"/>
            <property name="driverClass" value="org.apache.derby.jdbc.ClientDriver"/>
            <property name="idColumnType" value="VARCHAR(255)"/>
            <property name="dataColumnType" value="BLOB"/>
            <property name="dropTableOnExit" value="false"/>
            <property name="createTableOnStart" value="true"/>
            <property name="cacheName" value="foo"/>
           </properties>
          </loader >
               </loaders>
        
        
      The camel context is persisted as a BLOB in the data field of derby DB.
      Is there a way to persist the data in the format that we want - in line with the already existing fields in the Derby DB.

      i.e The derby DB has the following fields (Id, Breadcrumid, ShortxchangeId, ExchangeId, FromendPoint, ToEndPoint, ResendEndPoint, Message ..... etc)
      and we would like data from cache to populate those fields in instead of residing as a BLOB in the Data field.

       

       

             


      Thanks for your help!.

       

      -Bhavani