Hi guys -- hopefully this is an easy answer for someone! I've also
posted the problem to stack overflow:
http://stackoverflow.com/questions/9437498/sqlalchemy-stopping-a-long-running-query
I'm using sqlalchemy to query postgres. If a client timeout occurs,
I'd like to stop/cancel the long running postgres queries from another
thread. The thread has access to the Session or Connection object.
At this point I've tried:
session.bind.raw_connection().close()
and
session.connection().close()
and
session.close
and
session.transaction.close()
But no matter what I try, the postgres query still continues until
it's end. I know this from watching pg in top. Shouldn't this be
fairly easy to do? I'm I missing something? Is this impossible without
getting the pid and sending a stop signal directly?
Thanks so much,
Cody