The query executes against the Lawson IOS server over http/https. Think of it like a huge web page loading into the browser. There is nothing to clean up. A query that is running too long will simply timeout.