OracleConnectionCacheImpl usage in servlets

From: Christopher B Hamlin <chamlin_at_optonline.net>
Date: Sat, 10 Feb 2001 21:38:29 GMT
Message-ID: <3A85B696.FD87503B_at_optonline.net>


  Hi,

  I can get it to work, and have hooked it into a static class variable when JRun is initialized. This gives connection pooling across the whole JVM.

  But I got a stack-empty exception under load and I wonder if it is thread-safe? DataSource has a synchronized getConnection, but I don't think OracleConnectionCacheImpl does -- does this mean it is not thread safe?

  If not, . . .

  So far, the cache is being implemented by a wrapper class we've been using all along. I can synchronize the getConnection on that class, but for the close() I guess we'll have to do a little more. We'll have to change all close() calls with a call to some wrapper that also gets synchronized access to the cache instance?

  I also wonder if the cache implementation should be timed out, and if it maybe uses a round-robin distribution to avoid any one connection going idle for too long. Maybe best is to just time out the whole cache object?

  Thanks for any ideas,

  Chris Hamlin

  chamlin_at_optonline.net Received on Sat Feb 10 2001 - 22:38:29 CET

Original text of this message