>Thanks for all the suggestions. Although these are all good suggestions, my
>main concern was not how to get the report to work but rather a way to have
the
>oracle process killed if the user presses stop. Since the real issue here is
>not that the report runs so long, but that the query continues to run for no
>reason (since the results will never be seen).
>
>There is no way I can generate all of the possible reports nightly, since the
>user is given the ability to enter date ranges to report on.
>
>If there is no way to catch the stop, then the only solution seems to be the
>email approach. Only problem here is that if the user actually did make a
>mistake (wrong date range for instance) the process generating the data would
>continue to run for no purpose.
I had a different problem recently but it also involved a long-standing HTTP
connection and detecting disconnect. There's a patch in the CVS tree that
defines Apache->connection->fileno, which is the client file descriptor (aka
ap_bfileno). When the client disconnects, a zero-byte packet becomes available
for
read on that descriptor.
In my application I am talking to a backend server through another socket, so I
was able to do a select() on both descriptors. You might be able to adapt this
to your situation, the goal would be to have your mod_perl script sitting in a
select() waiting on both events: client disconnect and oracle query
termination.
I'm pretty sure there's way to make this work, using open2 on a second script
that does the actual oracle query, If you're interested let me know and I'll
get
into details.
--
Eric