I'm having trouble setting up a JdbcConnectionDescriptor programatically.
I'm adding a ConnectionPoolDescriptor, SequenceDescriptor and an
ObjectCacheDescriptor to the JdbcConnectionDescriptor but the
ObjectCacheDescriptor doesn't appear when I call
JdbcConnectionDescriptor.toXML() and doesn't have any effect when the
application is running. Here is my code:
********
JdbcConnectionDescriptor jcd = new JdbcConnectionDescriptor();
jcd.setJcdAlias("mainConnection");
jcd.setDatasourceName("java:comp/env/jdbc/mainConnection");
jcd.setDbms("MySQL");
jcd.setJdbcLevel(3.0);
jcd.setBatchMode(false);
jcd.setUseAutoCommit(1);
jcd.setIgnoreAutoCommitExceptions(false);
ObjectCacheDescriptor ocd = new
ObjectCacheDescriptor(ObjectCacheTwoLevelImpl.class);
ocd.addAttribute("applicationCache",
"org.apache.ojb.broker.cache.ObjectCacheDefaultImpl");
ocd.addAttribute("copyStrategy",
"org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl$CopyStrategyImpl");
ocd.addAttribute("timeout", "900");
ocd.addAttribute("autoSync", "true");
ocd.addAttribute("cachingKeyType", "1");
ocd.addAttribute("useSoftReferences", "true");
log.debug(ocd.toXML());
ConnectionPoolDescriptor cpd = new ConnectionPoolDescriptor();
cpd.setLogAbandoned(true);
cpd.setValidationQuery("SELECT 1");
jcd.setConnectionPoolDescriptor(cpd);
jcd.setObjectCacheDescriptor(ocd);
jcd.setSequenceDescriptor(new SequenceDescriptor(jcd,
SequenceManagerNativeImpl.class));
connectionRepository.addDescriptor(jcd);
log.debug(jcd.toXML());
*********
I can't use an XML file for reasons I won't go into here. Can anyone see
what I might be doing wrong here? Has anyone else attempted to do this? Any
help would be much appreciated.
Thanks,
Steve Vangasse
Boardshop.co.uk - Board Sports Equipment and Clothing for the UK and Europe
www.boardshop.co.uk
0870 0600 688
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]