<div class="gmail_quote">On 28 November 2011 15:43, Dave Himrod <span dir="ltr"><<a href="mailto:dhrod5@gmail.com">dhrod5@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":12l">I wrote a database/connection wrapper that can connect to different types of databases (mysql, netezza, vertica and mysql). A problem we have is that hitting ctrl-c does not necessarily kill the query, sometimes the ctrl-c interrupt isn't even handled until the query returns. Does anyone have any experience with this? How can I handle the sigint to stop the query? Is there a generic way for me to tell the databases to kill the queries on their end as well so it does not go zombie, I am hoping it is not specific to each db and is part of the pyodbc or mysqldb packages?<br>
</div></blockquote><div><br>Is this only a problem in IPython? Have you tried Ctrl-C when a query is running from a standard Python interpreter?<br><br>I haven't done much database programming, but I expect that each database might need a specific command to kill the query. E.g. a quick search turned up this for MySQL: <a href="http://price.mit.edu/blog/2010/06/killing-a-mysql-query/">http://price.mit.edu/blog/2010/06/killing-a-mysql-query/</a><br>
<br>Thomas<br></div></div><br>