summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorrwillert <robert.willert@conceptpeople.de>2012-07-10 13:02:01 +0200
committerrwillert <robert.willert@conceptpeople.de>2012-07-10 13:02:01 +0200
commit824085200b3362bfe1db1ecce52bf555dd064b57 (patch)
treeca8833d7fd3b0007c0f1c646d9d82dd09db3c2cb /system/database
parentcbb654d9b332b65c5e2ae6f7bf8936b425b709ac (diff)
Reconnect to PostgreSQL database if connection droped.
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/postgre/postgre_driver.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 20b78673e..c24c523de 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -132,7 +132,15 @@ class CI_DB_postgre_driver extends CI_DB {
*/
public function db_pconnect()
{
- return @pg_pconnect($this->dsn);
+ $conn = @pg_pconnect($this->dsn);
+ if ($conn && pg_connection_status($conn) === PGSQL_CONNECTION_BAD)
+ {
+ if (pg_ping($conn) === FALSE)
+ {
+ return FALSE;
+ }
+ }
+ return $conn;
}
// --------------------------------------------------------------------