Sleeping queries related to databases...

This is the place to post technical queries about SQL Yoga

Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, trevordevore

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Sleeping queries related to databases...

Post by trevordevore » Fri Oct 11, 2013 2:28 pm

[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
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Sleeping queries related to databases...

Post by trevordevore » Fri Oct 11, 2013 2:28 pm

Hi Josep,

I'm not sure I understand. What is a sleeping query? Are you finding that their are open cursors?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Sleeping queries related to databases...

Post by trevordevore » Fri Oct 11, 2013 2:28 pm

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
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Re: Sleeping queries related to databases...

Post by trevordevore » Fri Oct 11, 2013 2:28 pm

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.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply

Return to “SQL Yoga”