Page 1 of 1

Sleeping queries related to databases...

Posted: Fri Oct 11, 2013 2:28 pm
by trevordevore
[This post is an archive from the old SQL Yoga forums]

Hi,

Today I discovered that many queries left sleeping after connect to mySQL databases.

How can check this to be closed?

Salut,

Josep

Re: Sleeping queries related to databases...

Posted: Fri Oct 11, 2013 2:28 pm
by trevordevore
Hi Josep,

I'm not sure I understand. What is a sleeping query? Are you finding that their are open cursors?

Re: Sleeping queries related to databases...

Posted: Fri Oct 11, 2013 2:28 pm
by trevordevore
I think those are connections that have not been closed, perhaps when the connection is broken the connection is not cut from the database and remains open.
I do not know, but from our IP we have been advised that there are many dormant connection.
So my question is if I have to do something to close the application or create any work to close these connections from SQL Yoga.
I think those are connections that haven't been closed, perhaps when the database lost the connection isn't disconnected from the database and remains open.
I do not know, but from our IP we have been advised that there are many sleeping connections.


So my question is if I have to do something when close the application or create any function to close these connections from SQL Yoga.

Or any suggestion how to avoid this.


Salut,

Josep

Re: Sleeping queries related to databases...

Posted: Fri Oct 11, 2013 2:28 pm
by trevordevore
SQL Yoga does it's best to clean up after itself. You should be calling dbconn_disconnect before your app closes. When SQL Yoga tries to reconnect in situations where MySQL reports that it has gone away then dbconn_disconnect is called.

Can you confirm that their are actually database connections open within your application? SQL Yoga is using revDB so you can check to see if revOpenDatabases returns any values. It may be that RevDB isn't closing the connection properly. If revOpenDatabases returns open connections and you are calling dbconn_disconnect then we can start investigating further.