[TYPO3-core] RFC #11770: Feature: mysql_ping wrapper

Ries van Twisk typo3 at rvt.dds.nl
Mon Aug 24 22:03:59 CEST 2009


On Aug 24, 2009, at 2:43 PM, Martin Kutschker wrote:

> Ries van Twisk schrieb:
>> Looking at class.ux_t3lib_db.php,
>>
>> in the case of DBAL you can connect to multiple database so you might
>> want to test all connected databases and
>> do something appropriate OR at least log a message that this function
>> does not support DBAL and
>> only will ONYL ping a native mysql DB.
>>
>> However just returning TRUE might lead to incorrect decisions for a
>> programmer when using this function and DBAL with non-mysql  
>> databases,
>> or one native DB and a non-native DB...
>>
>>
>> One potential problem I see with this function is that mysql_ping can
>> reconnect!!!! (really stupid decission of these people.....)
>
> Seems the PostgreSQL folks liked it too:
>
> pg_ping() pings a database connection and tries to reconnect it if  
> it is
> broken.
>
> Basically *_ping() is a classic NOOP statement also found eg in the  
> IMAP
> protocol to get a connection keep-alive.

>
> Masi

Masi,

It's stills stupid that that a pg_ping commando will re-connect,
it really doesn't make sense and will clutter the API with commands
that do more then they suppose to do and I don't think it's a good idea.

looking at pg_ping's implementation :
res = PQexec(pgsql, "SELECT 1;");

I am not sure of mysql_ping really 'pings' the connection and will  
keep it alive,
it more looks like that mysql_ping doesn't ping the server.... can  
anybody confirm?


For everybody's info, the pg doc is correct... pg_ping will really try  
to re-connect,
so pg_pings behavior IS different then mysql_ping.



Ries



			regards, Ries van Twisk

-------------------------------------------------------------------------------------------------
tags: Freelance TYPO3 Glassfish JasperReports JasperETL Flex Blaze-DS  
WebORB PostgreSQL DB-Architect
email: ries at vantwisk.nl        web:   http://www.rvantwisk.nl/     
skype: callto://r.vantwisk
Phone: +1-810-476-4196    Cell: +593 9901 7694                   SIP:  
+1-747-690-5133









More information about the TYPO3-team-core mailing list