Hi All,
Long after I am posting new topic.
After getting succeeded with hibernate search in an application, I need to enhance search to multi-node environment. (currently 4 nodes).
I am interested with shared index approach.(Not Master-Slave approach).
Can Anyone suggest me the configuration changes to be done to achieve this?
My current hibernate.cfg.xml:<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">
org.hibernate.dialect.PostgreSQLDialect
</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">jta</property>
<!-- Enable the second-level cache -->
<!-- Provider is JBoss Cache -->
<!--<property name="cache.provider_class">org.jboss.hibernate.jbc.cacheprovider.JndiBoundTreeCacheProvider</property>-->
<property name="hibernate.cache.jndi">
JndiBoundTreeCacheInstance
</property>
<!-- Transaction factory that supports JTA -->
<property name="transaction.factory_class">
org.hibernate.transaction.JTATransactionFactory
</property>
<!-- enable caching of entities and collections -->
<property name="cache.use_second_level_cache">true</property>
<!-- enable caching of query results -->
<property name="cache.use_query_cache">true</property>
<property name="cache.region.jbc2.query.localonly">
true
</property>
<!-- JBoss Cache configuration file name -->
<property
name="cache.provider_configuration_file_resource_path">
jboss-cache.xml
</property>
<!-- To use JBoss Cache 2 as your Second Level Cache implementation -->
<property name="cache.region.factory_class">
org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory
</property>
<!-- Use query cache too -->
<property name="cache.use_query_cache">true</property>
<!-- JBoss Transactions Manager lookup class -->
<property name="transaction.manager_lookup_class">
org.hibernate.transaction.TransactionManagerLookup
</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<event type="post-update">
<listener
class="org.hibernate.search.event.FullTextIndexEventListener"/>
</event>
<event type="post-insert">
<listener
class="org.hibernate.search.event.FullTextIndexEventListener"/>
</event>
<event type="post-delete">
<listener
class="org.hibernate.search.event.FullTextIndexEventListener"/>
</event>
</session-factory>
</hibernate-configuration>
My current persistence.xml:<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd"
version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="db1">
<jta-data-source>java:xab2</jta-data-source>
<properties>
<property name="hibernate.ejb.cfgfile"
value="/META-INF/hibernate.cfg.xml" />
<property name="jboss.entity.manager.jndi.name"
value="persistence-units/apptivodb2" />
<property name="hibernate.ejb.event.post-insert"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-update"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.search.default.indexBase" value="/home/skuppusamy/Hibernate/Indexes"/>
</properties>
</persistence-unit>
</persistence>
Please let me the configuration changes......
Thanks in Advance,
Sorna.K