ADVANTAGE
PHP will keep connection pooling with MySQL, which allows you to reduce connection time and to use old connection in a new script.
If use $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); any error will throw an exception.
DISADVANTAGE
Must use the register_shutdown_function to reset the connection if the transaction has not been committed
Any further information about this topic on this page:
http://www.php.net/manual/en/features.persistent-connections.php
1 Comment
Login to post a comment.
Thanks for suggesting this idea.
What problem are you currently needing to solve to which this would be a good solution?