[Mimedefang] Mysql connections

Paul Murphy Paul.Murphy at argentadiscovery.com
Thu Dec 14 12:18:51 EST 2006



>>> "Mack" <roaringpenguin.com at bass-speaker.com> 14/12/2006 16:36 >>>
> Be very careful with connect_cached though, as I have noticed that you get a
> SQL server has gone away when you try to use the connection, even though the
> connect cached still thinks it is open and pings (after maybe 6-12hrs
> inactivity - so shouldn't be a prob on a busy site though!)

I've had this as well, and posted about it a couple of times without any answer.  Today I had a further think, and although I haven't tested this yet, I have an idea...

The greylist code I use tries to be "sensible" in its use of the database, calling dbh->prepare to pre-parse the SQL statement once, and then calling execute() many times.  However, using connect_cached(), the connection can be silently dropped and recreated between execute() calls, and as a result the pre-prepared statement handle is probably no longer valid.

If you put a dbh->prepare statement immediately before each execute(), it should work...bearing in mind that I haven't been able to test this.

Paul.
 
 
-- 

-------------------------------------------------------
Paul Murphy
Head of I.T.
Argenta Discovery
Tel. 01279 645 554
Fax. 01279 645 646






More information about the MIMEDefang mailing list