[redland-dev] MySQL server has gone away

Sean E. McBride Sean.McBride at students.olin.edu
Thu Sep 7 19:10:37 UTC 2006


Yeah, that was me. Here's the resolution of the problem. I:

a) Couldn't get my system setup to compile Redland so I could test the
patch. (I'm new to Linux and on Ubuntu, neither of which helped.)

b) Instead of spending more time on that, I slightly restructured my
application so that all the requests for a model come through a single
location and a len(model) is performed before returning. This will throw
the error, which is subsequently caught and reconnected if the
connection has been lost. Works like a charm.

Thanks for the help! And also all of the hard work on Redland.

- Sean

-----Original Message-----
From: Dave Beckett [mailto:dave at dajobe.org] 
Sent: Wednesday, September 06, 2006 10:18 AM
To: Sean E. McBride
Cc: redland-dev at lists.librdf.org
Subject: Re: [redland-dev] MySQL server has gone away

Sean E. McBride wrote:
> Hi, I'm using the latest version of Redland's Python bindings in
Ubuntu.
> I'm working on a web application for my college that allows students
to
> see what movies/books/cds other students have, and it uses an RDF
> Redland database with MySQL storage. When the application is dormant
> (nobody uses it) for more than 8 hours, the application starts
throwing
> this error:
> 
> Error(RedlandError): MySQL query failed: MySQL server has gone away
> 
> I've run into this error in other contexts before, and I'm pretty sure
> it's because the MySQL connection isn't being made with the
reconnect=1
> option. Is there any way to force Redland to use the reconnect option
> for MySQL stores? Has anyone else had this problem?

Not currently although somebody asked on IRC about this (was it you?)
and I made a bug with untested patch to do this.

http://bugs.librdf.org/mantis/view.php?id=117

Dave


More information about the redland-dev mailing list