You are looking at documentation for an older release. Not what you want? See the current release documentation.
Frequently, a single database instance must be shared by several other applications, but you can host several JCR instances in the same database instance. To fulfill this need, you have to review your queries and scope them to the current schema; it is now possible to have one JCR instance per DB schema instead of per DB instance. Also, you will need to apply the configuration changes described below.
To enable this feature, you need to replace org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedStore
with
org.exoplatform.services.jcr.infinispan.JdbcStringBasedStore
in infinispan configuration file.
Here is an example of this very part of the configuration:
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:infinispan:config:8.2"
xsi:schemaLocation="urn:infinispan:config:8.2 http://www.infinispan.org/schemas/infinispan-config-8.2.xsd">
<threads>
<thread-factory name="infinispan-factory" group-name="infinispan" thread-name-pattern="%G %i" priority="5"/>
<!-- listener-executor -->
<blocking-bounded-queue-thread-pool name="infinispan-listener" thread-factory="infinispan-factory" core-threads="1"
max-threads="5" queue-length="0" keepalive-time="0"/>
</threads>
<jgroups transport="org.infinispan.remoting.transport.jgroups.JGroupsTransport">
<stack-file name="stack" path="${exo.jcr.cluster.jgroups.config}"/>
</jgroups>
<cache-container name="lock-manager" default-cache="default" listener-executor="infinispan-listener"
statistics="true">
<jmx duplicate-domains="true" domain="jcr.ispn.cache" mbean-server-lookup="org.infinispan.jmx.PlatformMBeanServerLookup"/>
<transport cluster="${exo.cluster.partition.name}-jcr-lock" stack="stack" lock-timeout="240000"/>
<replicated-cache-configuration mode="SYNC" name="default" statistics="true" remote-timeout="${exo.jcr.cluster.lock.sync.repltimeout:240000}">
<locking isolation="READ_COMMITTED" concurrency-level="500" striping="false" write-skew="false"
acquire-timeout="${exo.jcr.lock.lockacquisitiontimeout:180000}"/>
<transaction transaction-manager-lookup="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" mode="NON_XA"/>
<state-transfer enabled="${exo.jcr.cluster.lock.statetransfer.fetchinmemorystate:false}"
timeout="${exo.jcr.cluster.lock.statetransfer.timeout:240000}"/>
<eviction strategy="NONE" />
<expiration lifespan="-1" />
<persistence passivation="false">
<string-keyed-jdbc-store xmlns="urn:infinispan:config:store:jdbc:8.0" shared="true" fetch-state="true"
read-only="false" purge="false" preload="true">
<string-keyed-table drop-on-exit="${infinispan-cl-cache.jdbc.table.drop}" create-on-start="${infinispan-cl-cache.jdbc.table.create}"
prefix="${infinispan-cl-cache.jdbc.table.name}">
<id-column name="${infinispan-cl-cache.jdbc.id.column}" type="${infinispan-cl-cache.jdbc.id.type}" />
<data-column name="${infinispan-cl-cache.jdbc.data.column}" type="${infinispan-cl-cache.jdbc.data.type}" />
<timestamp-column name="${infinispan-cl-cache.jdbc.timestamp.column}" type="${infinispan-cl-cache.jdbc.timestamp.type}" />
</string-keyed-table>
</string-keyed-jdbc-store>
</persistence>
</replicated-cache-configuration>
</cache-container>
</infinispan>
You can also obtain a file example from GitHub.
HibernateService configuration
If you use HibernateService
for JDBC connections management, you will
need to specify explicitly the default schema by setting the
"hibernate.default_schema
" property in the configuration of
HibernateService
.
Here is an example:
<component>
<key>org.exoplatform.services.database.HibernateService</key>
<jmx-name>database:type=HibernateService</jmx-name>
<type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
<init-params>
<properties-param>
<name>hibernate.properties</name>
<description>Default Hibernate Service</description>
...........
</properties-param>
</init-params>
</component>