[Tickets #12656] Re: Horde pings SQL server with each database query

noreply at bugs.horde.org noreply at bugs.horde.org
Wed Sep 4 17:40:39 UTC 2013


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/12656
------------------------------------------------------------------------------
  Ticket             | 12656
  Updated By         | arjen+horde at de-korte.org
  Summary            | Horde pings SQL server with each database query
  Queue              | Horde Framework Packages
  Version            | Git master
  Type               | Enhancement
  State              | New
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
+New Attachment     | only-ping-sql-on-error.diff
------------------------------------------------------------------------------


arjen+horde at de-korte.org (2013-09-04 17:40) wrote:

My first shot at trying to reduce the number of pings to the SQL database.

Assume the connection to the database is good (which will generally be  
the case) and send queries straight away. Only ping the SQL database  
if an exception occurs (much less common). If the server doesn't  
respond, reconnect and try again (up to three times). If does respond  
to the ping, assume something else was wrong and throw exception as  
usual.

The logic might be improved by interpreting $e->getMessage(). If it  
contains 'SQLSTATE[08', there is a definitly a connection problem and  
we should reconnect. But I'm not sure if all supported SQL databases  
support this status code, hence the (slightly less efficient) ping.



arjen+horde at de-korte.org (2013-09-04 17:40) uploaded:  
only-ping-sql-on-error.diff

http://bugs.horde.org/h/services/download/?app=whups&actionID=download_file&file=only-ping-sql-on-error.diff&ticket=12656&fn=%2Fonly-ping-sql-on-error.diff





More information about the bugs mailing list