You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tobias Wagener <pe...@wagener.nu> on 2010/07/22 12:34:50 UTC

Need help with abort connection

Hello,

I'm using 
  > apache     2.2.3 
  > mod_perl   2.0.2
  > mod_apreq2 2.08
on a linux box.

In my enviroment a user can submit a query to a database. This request
is handled as an Ajax-request. If he forget to add some search parameters
this query can run a long time. So I add a "Cancel"-Button to the frontend
that abort the request. That will work with no problems. But on the
server side the request/query keeps on running.

My handler first collect all data and then send the header and print
the content. Because the handler works for Ajax and "normal" Requests
and first after finishing the complete request I can decide if the
"Content-Type" is html/pdf/json/xml/etc.

Can someone give me a hint or better a solution how I can abort the
request on the server side, too.

Please excuse my english, but I hope you understand my question ;-)

Best regards,

Tobias


Re: Need help with abort connection

Posted by Andreas Mock <An...@web.de>.
Hi Tobias,

your whole scenario depends on the possibility to reliably
cancel a running query on the database.

If your database and client (software) is able to do so,
which has to be tested, the cancel button could send
another ajax request with an identifier of the initial
query which then would be canceled on the server side.

That on the other handside would mean that your initial
query request would put the query in a queue with an id,
send the id back immediately, redirecting the client to
an response page wich would present the query result
when available. Beware of TCP-IP timeouts, so that the
resultpage should redirect to itself regularly.

Best regards
Andreas



-----Ursprüngliche Nachricht-----
Von: Tobias Wagener <pe...@wagener.nu>
Gesendet: 22.07.2010 12:34:50
An: modperl@perl.apache.org
Betreff: Need help with abort connection

>Hello,
>
>I'm using 
>  > apache     2.2.3 
>  > mod_perl   2.0.2
>  > mod_apreq2 2.08
>on a linux box.
>
>In my enviroment a user can submit a query to a database. This request
>is handled as an Ajax-request. If he forget to add some search parameters
>this query can run a long time. So I add a "Cancel"-Button to the frontend
>that abort the request. That will work with no problems. But on the
>server side the request/query keeps on running.
>
>My handler first collect all data and then send the header and print
>the content. Because the handler works for Ajax and "normal" Requests
>and first after finishing the complete request I can decide if the
>"Content-Type" is html/pdf/json/xml/etc.
>
>Can someone give me a hint or better a solution how I can abort the
>request on the server side, too.
>
>Please excuse my english, but I hope you understand my question ;-)
>
>Best regards,
>
>Tobias
>