In version 7.1 or maybe 7.2 (I can't remember), Oracle introduced a 
SQL*Net  configuration parameter  SQLNET.EXPIRE_TIME, which would check 
that the client was still connected, and if not would tidy up any 
resources, including dangling connections. I don't know if it's still 
supported under the later versions of SQL*Net, but it's something that you 
could look at

Dan





Henri Asseily <[EMAIL PROTECTED]>
23/11/2004 08:11

 
        To:     Bob Showalter <[EMAIL PROTECTED]>
        cc:     "'Kevin Bass'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED], 
[EMAIL PROTECTED], (bcc: Dan Horne/IT/AKLWHG/WHNZ)
        Subject:        Re: Killing a Process



On Nov 22, 2004, at 5:30 AM, Bob Showalter wrote:

> 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.
>

Note that while a plain CGI script might get a SIGPIPE, it won't be the 
case under mod_perl. There are no pipes under mod_perl and I have no 
idea how one would go about knowing if the user severed the connection.





********************************************************************************
NOTICE
This email and any attachments are confidential. They may contain privileged 
information or copyright material. If you are not an intended recipient, you 
should not read, copy, use or disclose the contents without authorisation as 
we request you contact us as once by return email. Please then delete the 
email and any attachments from your system.  We do not accept liability in 
connection with computer viruses, data corruption, delay, interruption, 
unauthorised access or unauthorised amendment. Any views expressed in this 
email and any attachments do not necessarily reflect the views of the 
company.
********************************************************************************

Reply via email to