Still working with oracle AQSessions, I am obliged to close my physical connections at irregular intervals, so I cannot use a timeout. The reason I need to close is that the oracle implementation of enqueue and dequeue on the session queues leaves some cursors open and after some time there is no more cursors left on the connection. Since I don't want to wait for the "out of cursors exception", it occurs at 1000 cursors, which I consider a waste of resources, I have created a counter in my connection pool class (the one that calls the real connection pool, currently proxool, before it was oracle but it lost connections) and when a connection has been reused 100 times I close it with ProxoolFacade.killConnecton(pool-alias,conn-id,false). The purpose it to make it close the connection with the mercifull=false => force=true unfortunately there are two bugs here:
the first is in proxool.ConnectionPool.expireConnection(long id, boolean forceExpiry)
where the catch catches ArrayIndexOutOfBoundsException, in JDK 1.3.1
the thrown exception is IndexOutOfBoundsException as shown below.
try {
proxyConnection = (ProxyConnection) proxyConnections.get(nextAvailableConnection);
} catch (IndexOutOfBoundsException e) {
nextAvailableConnection = 0;
proxyConnection = (ProxyConnection) proxyConnections.get(nextAvailableConnection);
}
The second is a little more subtile as you can see below:
killConnecton(String alias, long id, boolean merciful)
uses
ConnectionPoolManager.getInstance().getConnectionPool(alias).expireConnection(id, merciful);
to call:
expireConnection(long id, boolean forceExpiry)
The documentation says merciful=false => we force and the value false is passed to expireConnection.forceExpiry where false => don't force so ...
it is easy to make a work around but I suggest that you negate merciful when you pass it to forceExpiry.
Having worked a lot with your source the last week in order to try to implement support for the AQ Sessions (I was successfull, but it did not solve the open cursors problem so I dropped it again) I wonder if you know a good site or a good book where I can learn some more about proxies?
Thanks
Dorte
---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online |