ODBC access (closing connections)

Kay C Lan lan.kc.macmail at gmail.com
Tue Mar 24 01:49:41 EDT 2009


On Mon, Mar 23, 2009 at 9:43 PM, <Roger.E.Eller at sealedair.com> wrote:

> What happens if connections are left open?
> >
> > Sarah wrote:
> > I always store the connection ID in a global or a custom property as I
> > generally want to make one than one query after opening a database.
>

All I can tell you is connections stay open for a while - I imagine there is
a setting somewhere but the default in mySQL is long enough. I would suggest
testing for open databases before EVERY use of revOpenDatabase

Once, whilst developing a stack that carried out multiple queries on
opening, my system slowed to a crawl.I eventually tracked it down to
hundreds of open connections!! The reason, I kept typing "openStack" into
the message box which ran a script that opened a DB connection, but my
breakpoints and debugging never allowed the script to run to the point where
the DB connection was closed! Now I always test first before using
revOpenDatabase, even if I know there's no way there could be an open
connection.

HTH



More information about the use-livecode mailing list