[redland-dev] librdf and mysql connections?

Peter van Heusden pvh at sanbi.ac.za
Wed Jun 13 11:54:22 BST 2007


Hi Eric

At the end of that thread you mentioned writing a disconnect() method 
that frees everything - it didn't work for you - but it does seem to be 
working for us.

Thanks for the response!

Peter

Eric Hanson wrote:
> I had problems with this and never quite worked it out:
>
> http://lists.usefulinc.com/pipermail/redland-dev/2007-March/001521.html
>
> Eric
>
> Peter van Heusden wrote:
>   
>> Hi
>>
>> I have inherited a previous programmer's php-librdf code, and it seems
>> (at least with redland 1.0.6 on gentoo) to be producing vast numbers of
>> mysql connections that are never terminated. Specifically, the following
>> query fragment:
>>
>>    function query($sQuery) {
>>        // Execute RDQL query on Redland RDF model
>>
>>        $oNullUri =& librdf_new_uri($this->oWorld,"");
>>        // ^ No need to free since it is null.
>>
>>        $oQuery =& librdf_new_query(
>>                        $this->oWorld,"rdql",$oNullUri,$sQuery,$oNullUri
>>                   );
>>        $oResult =& librdf_query_execute($oQuery,$this->oModel);
>>
>>        librdf_free_query($oQuery);
>>
>>        return $oResult;
>>    }
>>
>> seems to be the culprit - each time librdf_new_query is called, a mysql
>> connection is opened. That connection remains open indefinitely. As a
>> result idle mysql connections pile up. I'm not sure if the problem is
>> redland being used with the wrong idiom, or if the problem is with
>> redland. How can I get to either re-use the same mysql connection, or
>> close it timeously?
>>
>> Thanks,
>> Peter
>> SANBI - South Africa
>>
>> _______________________________________________
>> redland-dev mailing list
>> redland-dev at lists.librdf.org
>> http://lists.librdf.org/mailman/listinfo/redland-dev
>>     
>
>   



More information about the redland-dev mailing list