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

manik.surtani@jboss.com do-not-reply at jboss.com
Fri Nov 2 09:24:27 EDT 2007


I wrote a unit test to incorporate pretty much what you are trying to test, with a few changes:

* Uses core cache instead of pojo cache, since this shouldn't be a factor in your test
* Uses Derby instead of Oracle, easier to set up and tear down during a unit test
* Tested on SVN trunk (2.1.0) rather than 2.0.0, but not much has changed wrt, the JDBCCacheLoader or connection management.

Both of the above should be irrelevant to what you are suggesting regarding the JDBCCacheLoader closing connections.

I don't see any stale connections or even the problem that you see - the test runs fine.  The unit test is here, if you want to have a look at it, and perhaps try and run it on Oracle if that makes any difference.

http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/core/trunk/src/test/java/org/jboss/cache/loader/JDBCCacheLoaderConnectionTest.java?view=markup

To try this out yourself, 

1) Check out trunk from SVN 

  | svn co http://anonsvn.jboss.org/repos/jbosscache/core/trunk
  | 

2) Run the test:

  | mvn clean test -Dtest=JDBCCacheLoaderConnectionTest
  | 

3) Edit src/test/java/org/jboss/cache/loader/JDBCCacheLoaderConnectionTest.java to connect to your Oracle DB instead

4) Repeat (2)


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

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



More information about the jboss-user mailing list