realbasic-nug
[Top] [All Lists]

Re: timing out mySQL database connections (was: Re: q on mySQL) plugin)

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: timing out mySQL database connections (was: Re: q on mySQL) plugin)
From: Richard Altenburg <realbasic at brainchild dot nl>
Date: Sun, 30 Mar 2003 15:12:58 +0200
On 30-03-2003 00:29, "Dave Slack" <nospam at forestdigital dot com> wrote:

> This is definitely one of the problems I'm facing with the RB MySQL
> plugin. Without more extensive documentation of the how the MySQL
> plugin connections work, I can't establish what will be a workable
> application behavior model except through some experimentation in RB.
> The timeout variables in the MySQL database I'm connecting to don't
> seem to reflect the actual behavior I see in the the use of an
> always-open MySQL database connection in RB. My choice of no more than
> 5 minutes of an idle connection actually appears to be good choice,
> because I've found if I don't refresh the connection at that point,
> accessing the open database connection crashes the app at the
> executable level and the app crashlog shows what appears to be another
> crash in the plugin code. I'm hoping to experiment a bit more with the
> settings on the MySQL side and what I'm doing on the RB side and see if
> I can establish a relationship between the two, though.

For managing a jokes site (no, I am not funny at all, but my 10 year old
daughter is) I wrote a REALbasic application that loads jokes from the
remote MySQL-database that the site is based on.

You can then click on titles of jokes, and you will get the complete entry.
This can be jokes already on the site, and new jokes added by the visitors.
These jokes can be edited and approved for publishing on the site.

During the management, lots of reads and writes go in and out of the
database. And it never lets us down...

What I do, is that I use my own SQL-execution method. I send every request
through that method, which first calls the Connect-method of the database.
If it returns True, the rest of the request can be sent and executed by the
MySQL-system. If Connect returns False, no connection could be made, and I
warn the user (myself or my daughter).

So in fact, for every SQL command, I try to Connect again, and it always
works. I have never had the situation that after 250 connections or so my
program crashed. Or didn't I ever reach that?

So I don't worry about the timeout set by the provider. And don't depend on
them that way. It is just like a web page with PHP in it (my site uses
that): every request from a visitor is a new connection to the database, and
it works like charm...

(setup: RB 4.5.2 on MacOS 9, MacOS 10 and Windows XP - my jokes-manager
works on all of them and is in practice used on all three)


---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>

Subscribe to the digest: 
<mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.


<Prev in Thread] Current Thread [Next in Thread>