We have application which contains the apache web server as entry point and application will run on another server. So in apache we configured the timeout as 40 secs, but in the application some query is taking more time to fetch the records which is more than 40 secs, due to that reason apache is throwing 5xx error. But the query is fetching the records from the DB after we got response from apache web server.
How to kill that query(or transaction) after 40 secs(i.e apache timeout)?
Thanks in advance.