[redland-dev] Free MySQL Connections

Simon Cross simon at sanbi.ac.za
Mon Feb 14 08:12:16 GMT 2005


On Sat, 2005-02-12 at 23:45 +0000, Dave Beckett wrote:
> On Mon, 2005-01-24 at 10:20 +0000, Dave Beckett wrote: 
> > On Mon, 10 Jan 2005 19:54:16 +0200, Simon Cross <simon at sanbi.ac.za> wrote:
> > 
> > > Greetings,
> > > 
> > > I'm using the Redland PHP bindings.  If I perform a query but stop
> > > iterating through the results before they've been exhausted then MySQL
> > > connections are left hanging until the process exits.  If I iterate all
> > > the way through the results then the connections get closed.
> > > 
> > > I'd like to have the temporary connections associated with the query be
> > > closed once the result and query have been freed (even if the full
> > > results weren't used).
> > > 
> > > Any idea how I could achieve this?
> > 
> > It should be freeing the connections when you free the result and query;
> > it's all streaming and should handle partial results.  I'll see if I
> > can work out where this is happening.
> 
> I think I've found and fixed this bug.  In the query engine, it failed
> to properly terminate and tidy up if the all the query results aren't
> read.   This is also part of the problem with the bug Christopher
> Schmidt reported later on repeated queries, I'll reply to that shortly.
> 
> I've not checked it with Mysql + PHP but I'm hoping it does since I've
> not got an easy setup to run that.
> 
> The patch itself is quite small so I've attached it below.

Great!

Work has temporarily sidetracked me to non-RDF stuff but I'll try out
the patch in the next few days and give a report back. And thanks! :)

Schiavo
Simon



More information about the redland-dev mailing list