Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Help with Oracle JDBC pooling classes...
I have written some tests to demonstrate that conneciton pooling is working
properly, however I am not getting the expected results.
Using class oracle.jdbc.pool.OracleConnectionCacheImpl and methods
getConnection, getActiveSize and getCacheSize, I atempt to measure the cache
utilization.
a) If I call getConnection 10 times (pool min=2, max=10, schema is dynamic
ir fixed wait, no difference) on one thread, the stats are returned as
expected: getActiveSize = 10, getCacheSize = 10. But the connections do not
appear to be released no matter how much idle time passes. Is there no idle
time logic in this class?
b) if I start 10 threads and each one calls getConnection and blocks waiting
for a signal, and the main thread does the same as in (a), the active size =
0 and the cache size = 2, as if the cache were never utilized at all!
Using class oracle.jdbc.pool.OracleOCIConnectionPool (from 9i client)
initialized to (min=2, max=10, timeout=4, nowait=false), it is even worse...
c) calling getConnection 10 times still yields a pool size of 2 and an
active size of 0
d) using 10 threads where each calls getConnection and blocks (even if the
thread also gets a statement and obtains a result set), still pool size of 2
and active size of 0 is reported!
Please note that for the multithreaded tests I have verified via trce the exact sequence of events - please do not assume that my threads "just haven't executed the code yet".
So is there some other notion of "active" that I am not understanding, or are these pool measuring methods broken? Is pooling working at all? Why does it behave differently with multiple threads for the OracleConnectionCacheImpl?
Thanks for any and all info - I'm really at a loss!
![]() |
![]() |