-
1. Re: JDBCCacheLoader Problems
manik Jul 21, 2006 12:34 AM (in response to chicago_pool_dude)1) You should not construct a Cache Loader explicitly. When you start the cache, a cache loader is created and configured for you based on your configuration file.
2) Your configureCache() method is unnecessary.
3) Your getConfigFile() method should return the name of an XML file (as a String) which needs to be in your classpath. This XML file would contain the cache configuration. -
2. Re: JDBCCacheLoader Problems
chicago_pool_dude Jul 24, 2006 11:33 AM (in response to chicago_pool_dude)Thanks for your earlier replies Mr Manik Surtani I tried what you suggested but still i have problems with JDBC Cache Loader...I am assumging that there is some problem with XML file i am posting it maybe you can let me know the problem. When i use a properties file and pass it on to JDBC Cache Loader class explictly i have no problem but when i configure using xml i am not able to bind the TreeCache to JDBC. Here is the XML
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- Sample TreeCache Service Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- ==================================================================== -->
<!-- Defines TreeCache configuration -->
<!-- ==================================================================== -->
jboss:service=Naming
jboss:service=TransactionManager
<!--
Configure the TransactionManager
-->
org.jboss.cache.JBossTransactionManagerLookup
<!--
Node locking level : SERIALIZABLE
REPEATABLE_READ (default)
READ_COMMITTED
READ_UNCOMMITTED
NONE
-->
REPEATABLE_READ
<!--
Valid modes are LOCAL
REPL_ASYNC
REPL_SYNC
-->
LOCAL
true
<!-- Name of cluster. Needs to be the same for all clusters, in order
to find each other
TreeCache-Cluster
-->
<!-- Max number of milliseconds to wait for a lock acquisition -->
15000
<!-- Cache loader configuration -->
<!-- Name of the eviction policy class. -->
org.jboss.cache.eviction.LRUPolicy
<!-- Specific eviction policy configurations. This is LRU -->
5
<!-- Cache wide default -->
0
0
<!--
0
0
-->
false
/
false
org.jboss.cache.loader.JDBCCacheLoader
<!-- same as the old CacheLoaderConfig attribute -->
cache.jdbc.table.name=jbosscache
cache.jdbc.table.create=true
cache.jdbc.table.drop=false
cache.jdbc.table.primarykey=jbosscache_pk
cache.jdbc.fqn.column=fqn
cache.jdbc.fqn.type=varchar(255)
cache.jdbc.node.column=node
cache.jdbc.node.type=blob
cache.jdbc.parent.column=parent
cache.jdbc.driver=oracle.jdbc.OracleDriver
cache.jdbc.url=jdbc:oracle:thin:@localhost:1521:XE
cache.jdbc.user=system
cache.jdbc.password=seshu
<!-- whether the cache loader writes are asynchronous -->
true
<!-- only one cache loader in the chain may set fetchPersistentState to true.
An exception is thrown if more than one cache loader sets this to true. -->
true
<!-- determines whether this cache loader ignores writes - defaults to false. -->
true -
3. Re: JDBCCacheLoader Problems
chicago_pool_dude Jul 24, 2006 11:34 AM (in response to chicago_pool_dude)
false
/
false
org.jboss.cache.loader.JDBCCacheLoader
<!-- same as the old CacheLoaderConfig attribute -->
cache.jdbc.table.name=jbosscache
cache.jdbc.table.create=true
cache.jdbc.table.drop=false
cache.jdbc.table.primarykey=jbosscache_pk
cache.jdbc.fqn.column=fqn
cache.jdbc.fqn.type=varchar(255)
cache.jdbc.node.column=node
cache.jdbc.node.type=blob
cache.jdbc.parent.column=parent
cache.jdbc.driver=oracle.jdbc.OracleDriver
cache.jdbc.url=jdbc:oracle:thin:@localhost:1521:XE
cache.jdbc.user=system
cache.jdbc.password=password
<!-- whether the cache loader writes are asynchronous -->
true
<!-- only one cache loader in the chain may set fetchPersistentState to true.
An exception is thrown if more than one cache loader sets this to true. -->
true
<!-- determines whether this cache loader ignores writes - defaults to false. -->
true -
4. Re: JDBCCacheLoader Problems
manik Aug 7, 2006 1:40 PM (in response to chicago_pool_dude)sorry, coudl you post that snippet again, within [ code ] and [ / code ] tags?