You are here: Re: About mysql_pconnect « PHP Programming Language « IT news, forums, messages
Re: About mysql_pconnect

Posted by seaside on 12/22/06 04:20

seaside schrieb:

> Jørn Dahl-Stamnes schrieb:
>
> > I then changed mysql_connect to mysql_pconnect on the scripts and viola....
> > the amount of new connections to the SQL server dropped to only two.

Additionally, this excerpt from
http://www.php.net/manual/en/features.persistent-connections.php may be
of interest for others, who read this thread:

###
There are a couple of additional caveats to keep in mind when using
persistent connections. One is that when using table locking on a
persistent connection, if the script for whatever reason cannot release
the lock, then subsequent scripts using the same connection will block
indefinitely and may require that you either restart the httpd server
or the database server. Another is that when using transactions, a
transaction block will also carry over to the next script which uses
that connection if script execution ends before the transaction block
does. In either case, you can use register_shutdown_function() to
register a simple cleanup function to unlock your tables or roll back
your transactions. Better yet, avoid the problem entirely by not using
persistent connections in scripts which use table locks or transactions
(you can still use them elsewhere).
###

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация