[jboss-user] [JBossCache] - Re: JDBCCacheLoader problem in java application

gmeroz do-not-reply at jboss.com
Thu Nov 1 17:31:05 EDT 2007


The code to produce this error:

  | import org.jboss.cache.pojo.PojoCache;
  | import org.jboss.cache.pojo.PojoCacheFactory;
  | import org.jboss.cache.Fqn;
  | 
  | public class JDBCCacheTest {
  | 
  |     public static final String CONF_FILE = "jboss-cache.xml";
  |     public static void main(String[] args) {
  |         PojoCache cache = PojoCacheFactory.createCache(CONF_FILE, true);
  |         cache.getCache().removeNode(Fqn.fromString("C"));
  |         for (int i = 0; i < 100; i++) {
  |             cache.attach("C/"+ Integer.toString(i), Integer.toString(i));
  |             System.out.println("added "+i+" dummy node to Jboss cache.");
  |         }
  |     }
  | }
  | 
  | and jbosscache config file:
  | 
  |   | <?xml version="1.0" encoding="UTF-8"?>
  |   | 
  |   | <server>
  |   | 
  |   |     <classpath codebase="./lib/jboss" archives="jbosscache.jar,jboss-cache.jar, jgroups.jar,jboss-aop-jdk50.jar,javassist.jar,jboss-common-core.jar,jboss-serialization.jar,pojocache.jar"/>
  |   | 
  |   |     <mbean code="org.jboss.cache.TreeCache"
  |   |         name="jboss.cache:service=EngineServerTreeCache">
  |   | 
  |   |         <depends>jboss:service=Naming</depends>
  |   |         <depends>jboss:service=TransactionManager</depends>
  |   |         <depends>jboss.jca:service=DataSourceBinding,name=beDS</depends>
  |   |         <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.DummyTransactionManagerLookup</attribute>
  |   | 
  |   |         <attribute name="CacheMode">LOCAL</attribute>
  |   |         <attribute name="CacheLoaderConfiguration">
  |   |             <config>
  |   |                 <passivation>false</passivation>
  |   |                 <!--<preload>/</preload>-->
  |   |                 <shared>true</shared>
  |   | 
  |   |                 <cacheloader>
  |   |                     <class>com.bevents.infra.service.cache.JDBCCacheLoader</class>
  |   |                     <properties>
  |   |                         cache.jdbc.table.name=jbosscache_engine_cache
  |   |                         cache.jdbc.table.create=true
  |   |                         cache.jdbc.table.drop=true
  |   |                         cache.jdbc.table.primarykey=jbosscache_engine_cache_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.driver.OracleDriver
  |   |                         cache.jdbc.url=jdbc:oracle:thin:@dbms01:1521:besapp
  |   |                         cache.jdbc.user=some_db
  |   |                         cache.jdbc.password=some_db
  |   |                     </properties>
  |   | 
  |   |                     <async>false</async>
  |   |                     <fetchPersistentState>false</fetchPersistentState>
  |   |                     <ignoreModifications>false</ignoreModifications>
  |   |                     <purgeOnStartup>false</purgeOnStartup>
  |   |                 </cacheloader>
  |   |             </config>
  |   |         </attribute>
  |   |     </mbean>
  |   | 
  |   | </server>
  |   | 

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

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



More information about the jboss-user mailing list