[jboss-user] [JBossCache] - Re: Global caching

jboss2005_01 do-not-reply at jboss.com
Wed Jul 12 07:37:52 EDT 2006


Hello,


I modified the different configuration files mentionned above to the following configuration which seems to work quite well.

I appended the configuration script below within the tc5-cluster-service.xml .

<attribute name="CacheLoaderConfiguration">
  | 	<config>
  | 		<shared>true</shared>
  | 		<cacheloader>
  |                  <class>org.jboss.cache.loader.tcp.TcpDelegatingCacheLoader</class>
  | 			<properties>
  | 				host=[my-far-cache-hostname]
  | 				port=7500
  | 			</properties>
  | 			<async>true</async>
  | 			<fetchPersistentState>false</fetchPersistentState>
  | 			<ignoreModifications>false</ignoreModifications>
  | 		</cacheloader>
  | 	</config>
  | </attribute>


On my far cache I know use the following configuration script (located in the HttpCache-service.xml file mentionned before).

<server>
  | 	<classpath codebase="./lib" archives="jboss-cache.jar,jgroups.jar"/>
  | 	<mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=HttpCache">				
  | 		<attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>		
  | 		<attribute name="NodeLockingScheme">PESSIMISTIC</attribute>		
  | 		<attribute name="IsolationLevel">REPEATABLE_READ</attribute>		
  | 		<attribute name="CacheMode">LOCAL</attribute>		
  | 		<attribute name="UseInterceptorMbeans">true</attribute>		
  | 		<attribute name="LockAcquisitionTimeout">15000</attribute>		
  | 		<attribute name="CacheLoaderConfiguration">
  | 			<config>
  | 				<passivation>false</passivation>
  | 				<shared>false</shared>					
  | 				<cacheloader>
  | 					<class>org.jboss.cache.loader.JDBCCacheLoader</class>
  | 					<properties>
  | 						cache.jdbc.table.drop=false
  | 						cache.jdbc.table.create=true
  | 					       cache.jdbc.datasource=java:/HttpCacheDS
  | 					</properties>
  | 					<fetchPersistentState>false</fetchPersistentState>
  | 					<ignoreModifications>false</ignoreModifications>
  | 					<async>false</async>
  | 				</cacheloader>
  | 			</config>
  | 		</attribute>		
  | 		<depends>jboss:service=Naming</depends>
  | 		<depends>jboss:service=TransactionManager</depends>
  | 	<depends>jboss.jca:service=DataSourceBinding,name=HttpCacheDS</depends>		
  | 	</mbean>
  | 	
  | 	<mbean code="org.jboss.cache.loader.tcp.TcpCacheServer" 
  | 		   name="jboss.cache:service=TcpCacheServer">
  | 		<attribute name="BindAddress">[my-far-cache-host-name]</attribute>
  | 		<attribute name="Port">7500</attribute>
  | 		<attribute name="MBeanServerName">Default</attribute>			
  | 		<depends optional-attribute-name="Cache" proxy-type="attribute">jboss.cache:service=HttpCache</depends>
  | 		<depends>jboss.cache:service=HttpCache</depends>
  | 	</mbean>	
  | </server>
  | 


The session information is now distributed between the different nodes within the cluster and is stored in the database maintained by the far cache on the remote machine. When the cluster dies and gets restarted, session information is recovered from the database. So this works nice besides the problem when starting up the far cache.

The far cache allthough produces error messages when nodes in the cluster are being stopped. The error message I receive is the following:

anonymous wrote : 13:20:30,171 WARN  [TcpCacheServer] failed reading data, thread will terminate
  | java.io.EOFException
  |         at java.io.DataInputStream.readInt(DataInputStream.java:358)
  |         at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2724)
  |         at java.io.ObjectInputStream.readInt(ObjectInputStream.java:919)
  |         at org.jboss.cache.loader.tcp.TcpCacheServer$Connection.run(TcpCacheServer.java:202)
  |         at java.lang.Thread.run(Thread.java:595)


I though it might be usefull for you to know the current state of my different trials ;-)

Greetings,
Kurt

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957319#3957319

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957319



More information about the jboss-user mailing list