LiveCode SQL APIs
josh at dvcreators.net
Tue Feb 15 00:31:16 EST 2011
If you have multiple users for your db, you will not want persistent connections because there's a limit to how many simultaneous connections you can have to a MySQL db.
On Feb 14, 2011, at 3:08 PM, Paul Dupuis <paul at researchware.com> wrote:
> In other languages, in days gone by, it was good practice to keep the connection open if an application expected to issue multiple queries (such as a user driven reporting application) becuase there was overhead in setting up a connection and creating and opening a connection, executing a query, and closing a connection for each query could impact performance.
> With the speed of today's servers, databases, clients, networks, and LiveCode, I am not sure connection maintenance for performance has any noticeable impact.
> I am also interested because, even though I have tried to thoroughly trap for connection timeout error and execute code to reconnect, i still get "connection has gone away" errors every now and then. Instead of revising all my error raping code again, I am considering code for maintaining a persistent connection.
> On 2/14/2011 5:44 PM, Björnke von Gierke wrote:
>> I'm not a experienced sql - lc connection maker either, but i ask myself why to keep a connection alive? So I take the freedom to append my own question to yours:
>> Some people like to keep alive their DB connections. But isn't it usually a more robust approach to close the connection as soon as the query is handled?
>> I've found it useful to handle mass-writes slightly differently, but there is normally so much happening, that the DB connection doesn't really idle at all.
>> On 14 Feb 2011, at 23:38, Paul Dupuis wrote:
>>> I can think a few way to construct a "keep-alive" process to ensure that a connection to a MySQL database via the LiveCode database drivers doesn't time out. However, it occurs to me that folks who spend more time writing LiveCode MySQL applications than I may have come up with a "best" way to keep the connection from timing out, so I thought I would ask the list. An idle loop would do it, but using idle is not a "best" approach.
>>> Any "best" approaches out there that someone cares to share?
>>> Paul Dupuis
>>> Researchware, Inc.
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> Paul Dupuis
> Researchware, Inc.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode