Kevin Bass wrote: > I have a slight problem that I am attemping to solve. I am using > CGI/Perl (DBD Oracle) on Linux AS 2.1 to access to the database. When > users encounter problems on the web, they cancel (or press stop) in > their browsers. This will stop there browser interaction and also > cause the database connection to not disconnect which causes a > runaway process. Is there an article that I can read or a > procedure/module or process that someone has written within CGI or > DBI (or sometimes else) that will allow me to kill my database > connection when a users stops an execute within his/her browser? > Thanks!
When the user presses the "Stop" button on their browser, the only thing that happens is the connection back to the server is closed. The only way for your script to detect this is to try to send data back to the client. If the connection is closed, you'll receive SIGPIPE (which by default will terminate your process). You can catch the SIGPIPE and do a graceful shutdown on the db connection. If you're in the middle of a query, you won't be able to detect the connection being closed until the DBI call returns. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>