-
1. Re: Purge Policy for Connection Pools
adrian.brock May 23, 2006 4:42 AM (in response to weston.price)It is an option, but I'm not sure why you would this?
Creating/Destroying connections is quite expensive compared
to using them for most things (that is the reason why they are pooled :-)
Seems to me that such a policy would mean a small problem
with one connection leads to lots of work getting done to recycle the
whole pool?
If you did do this, it would have to behave like the flush()
where already checked out connections get destroyed when
the application has finished with them. -
2. Re: Purge Policy for Connection Pools
mamemc Jun 9, 2006 11:59 AM (in response to weston.price)I was searching on something different and saw this thread. So here's a thought from an outside person.
I don't think that auto-flushing an entire pool is that useful, but putting the power into the hands of the users let's them decide for themselves. If it isn't a lot of work, then expose the functionality.
A more useful feature in my opinion would be time based pool cleanup -- if a connection has been in use for more than minutes then consider cleaning it up. Why? firewalls. We occassionally get long running connections whacked by our firewall settings. If there is no traffic over the connection in 60 minutes the firewall chops it and neither side is notified because it isn't a normal socket closure. These are much more painful to detect and cleanup, so having the pool terminate it would be useful to us. It would be also useful if the calling thread gets a java exception that something has been terminated.
Final thought. Similar functionality (time based cleanup) might be appropriate for the pooled invokers as well. I see time based growth in the number of ESTABLISHED connections using netstat to watch a pool. As I monitor the logs, I cannot account for the number of ESTABLISHED connections that exist compared with the number of distinct pooled invoker threads I see executing work. Time based cleanup of threads might resolve this. (And yes, I know there is a timeout property but that affects reads on the socket...what if something just goes south?). -
3. Re: Purge Policy for Connection Pools
wmprice Jun 9, 2006 12:07 PM (in response to weston.price)Time based cleanup is already provided by the IdleRemover for connections that have not been in use for a specific interval. Removing a connection that had been used within this time period would not really make a lot of sense, being that the connection is still 'live' and as far as JCA is concerned, 'valid'. In this case, the onus is really on the adapter to determine the semantics of this type of stuff.
In 4.0.5 there is a new feature to validate connections (JDBC) on a background thread which removes some of the performance hit that previously plagued validation.
Typically, you would never receive a connection that is not 'valid', as in your firewall scenario. For different types of connections, this can mean different things. -
4. Re: Purge Policy for Connection Pools
weston.price Sep 27, 2006 12:34 AM (in response to weston.price)Note, the purge policy features did indeed make it in as a patch. This behavior functionality needs to be carried forward for 4.0.6. I will update JIRA to reflect this as well.
-
5. Re: Purge Policy for Connection Pools
djr667 Nov 28, 2006 5:06 AM (in response to weston.price)"adrian@jboss.org" wrote:
It is an option, but I'm not sure why you would this?
Creating/Destroying connections is quite expensive compared
to using them for most things (that is the reason why they are pooled :-)
If a Oracle 9i server is restarted then all the pooled connections are dead and useless. A purge in this case would remove the need to restart the JBoss server.
We have tried, in our case, redeploying all web-apps and redeploying all *-ds.xml - but neither helps. It is unclear to me what would happen anyway to EJB3 injected datasources if you were to redeploy a *-ds.xml file.
Dave -
6. Re: Purge Policy for Connection Pools
weston.price Dec 3, 2006 1:13 AM (in response to weston.price)Please post your issue on the user forum. If you are indeed running into issues we should and would like to know about it.