Re: Disconnect database connection after idle timeout

2014-11-14 Thread Vincent Veyron
On Thu, 13 Nov 2014 10:43:35 -0500 Perrin Harkins wrote: > Apache::DBI should also re-connect with no problems if a request comes in > after a connection has timed out. If that isn't happening, make sure you > are using Apache::DBI properly. > Hi Perrin, Nobody suggested using connect_cached,

Re: Disconnect database connection after idle timeout

2014-11-14 Thread Dave Morgan
On 11/13/2014 09:42 AM, Perrin Harkins wrote: On Thu, Nov 13, 2014 at 11:29 AM, Dr James Smith mailto:j...@sanger.ac.uk>> wrote: From experience - and having chatted with our DBAs at work, with modern Oracle and with MySQL keeping persistent connections around is no real gain and usually

Re: Disconnect database connection after idle timeout

2014-11-14 Thread Dave Morgan
What I don't understand is what you are worried about? Whether you are using Apache::DBI or David Wheelers DBIHandler (do I have that correct?) both will behave according to the configuration of the database and web server. Why not just let the servers decide whether to maintain or destroy a co

Re: Disconnect database connection after idle timeout

2014-11-14 Thread Perrin Harkins
On Fri, Nov 14, 2014 at 1:32 PM, Xinhuan Zheng wrote: > Are you implying that the performance will be suffered when using > mod_perl-enabled server processes as the front tier servers? Not performance, scalability. You can't handle as many requests per second if you use mod_perl without a front

Re: Disconnect database connection after idle timeout

2014-11-14 Thread Vincent Veyron
On Fri, 14 Nov 2014 08:30:18 -0500 Perrin Harkins wrote: > If you ever switch off AutoCommit in > your code, I'd suggest adding a cleanup handler that checks if the handle > is not currently in AutoCommit mode, and if not, issues a rollback and > switches it to AutoCommit. That protects against a

Re: Disconnect database connection after idle timeout

2014-11-14 Thread Xinhuan Zheng
Hi Parrin, > the huge mod_perl-enabled server process (with all of its system resources) > will be tied up until the response is completely written to the client. While > it might take a few milliseconds for your script to complete the request, > there is a chance it will be still busy for some

Re: Disconnect database connection after idle timeout

2014-11-14 Thread Perrin Harkins
On Fri, Nov 14, 2014 at 7:58 AM, Vincent Veyron wrote: > If I understand correctly, I could also use Apache::DBI and a persistent > connection for a similar result, modulo what you wrote in an earlier > message regarding the connection being more explicit (which I don't quite > grasp, I'll have t

Re: Disconnect database connection after idle timeout

2014-11-14 Thread Vincent Veyron
On Thu, 13 Nov 2014 17:40:05 -0500 Perrin Harkins wrote: > > No, that's perfect. Since pnotes gets cleaned up at the end of every > request, there's no danger of the handle sticking around. I assume you're > calling DBI->connect() to get the handle in the HeaderParser phase, and > using Apache::