-
1. Re: Implementing a custom jdbc cache store
nadirx Jan 25, 2013 3:42 AM (in response to ges)Unfortunately the only "guide" for writing custom cache loaders/store is the code itself, which I know is not ideal. We do plan on simplyfing the cachestore SPI greatly in Infinispan 6.0, but that will take time.
As for your second question: you can have multiple cachestores and they will chained together: the following example is for Infinispan 5.2, but it is easily adaptable to 5.1:
{code:xml}
<loaders>
<fileStore location="/tmp/mystore">
<async enabled="false"/>
</fileStore>
<stringKeyedJdbcStore xmlns="urn:infinispan:config:jdbc:5.2">
<dataSource jndiUrl="java:/mydatasource" />
<stringKeyedTable dropOnExit="false" createOnStart="true" prefix="ISPN">
<idColumn name="ID_COLUMN" type="VARCHAR(255)" />
<dataColumn name="DATA_COLUMN" type="BINARY(255)" />
<timestampColumn name="TIMESTAMP_COLUMN" type="BIGINT" />
</stringKeyedTable>
<async enabled="true"/>
</stringKeyedJdbcStore>
</loaders>
{code}