A javascript application is calling, with XMLHTTPREQUEST, a perl script to run MySQL SELECT queries using DBI. Those sql queries can take a while to execute, like 20-30 seconds.
It sometimes happens that the XMLHTTPREQUEST request is interrupted by the user. Example: The user changes his mind about a search criterion and restarts the search.