summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2009-02-27 17:29:59 +0100
committerDerek Jones <derek.jones@ellislab.com>2009-02-27 17:29:59 +0100
commit87cbafce2d6803af78714baf8bba64309c01fc33 (patch)
treeebc4797260b74b4959ac07cabaa97ba4236c3e2f /system/database
parentaf4fb22745413cac182064a495da83318a41fde9 (diff)
added reconnect() method to db drivers
Diffstat (limited to 'system/database')
-rw-r--r--system/database/drivers/mssql/mssql_driver.php16
-rw-r--r--system/database/drivers/mysql/mysql_driver.php19
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php19
-rw-r--r--system/database/drivers/oci8/oci8_driver.php16
-rw-r--r--system/database/drivers/odbc/odbc_driver.php16
-rw-r--r--system/database/drivers/postgre/postgre_driver.php19
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php16
7 files changed, 121 insertions, 0 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index ddc036da9..241b280d0 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -82,7 +82,23 @@ class CI_DB_mssql_driver extends CI_DB {
}
// --------------------------------------------------------------------
+
+ /**
+ * Reconnect
+ *
+ * Keep / reestablish the db connection if no queries have been
+ * sent for a length of time exceeding the server's idle timeout
+ *
+ * @access public
+ * @return void
+ */
+ function reconnect()
+ {
+ // not implemented in MSSQL
+ }
+ // --------------------------------------------------------------------
+
/**
* Select the database
*
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 2b05c3f15..334daf3a6 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -91,6 +91,25 @@ class CI_DB_mysql_driver extends CI_DB {
// --------------------------------------------------------------------
/**
+ * Reconnect
+ *
+ * Keep / reestablish the db connection if no queries have been
+ * sent for a length of time exceeding the server's idle timeout
+ *
+ * @access public
+ * @return void
+ */
+ function reconnect()
+ {
+ if (mysql_ping($this->conn_id) === FALSE)
+ {
+ $this->conn_id = FALSE;
+ }
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Select the database
*
* @access private called by the base class
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 6558112cd..74cfff44a 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -91,6 +91,25 @@ class CI_DB_mysqli_driver extends CI_DB {
// --------------------------------------------------------------------
/**
+ * Reconnect
+ *
+ * Keep / reestablish the db connection if no queries have been
+ * sent for a length of time exceeding the server's idle timeout
+ *
+ * @access public
+ * @return void
+ */
+ function reconnect()
+ {
+ if (mysqli_ping($this->conn_id) === FALSE)
+ {
+ $this->conn_id = FALSE;
+ }
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Select the database
*
* @access private called by the base class
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index 4dfec2e3f..f4ef42a18 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -98,6 +98,22 @@ class CI_DB_oci8_driver extends CI_DB {
// --------------------------------------------------------------------
/**
+ * Reconnect
+ *
+ * Keep / reestablish the db connection if no queries have been
+ * sent for a length of time exceeding the server's idle timeout
+ *
+ * @access public
+ * @return void
+ */
+ function reconnect()
+ {
+ // not implemented in oracle
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Select the database
*
* @access private called by the base class
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index f7db4ca4b..2e529f32d 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -82,6 +82,22 @@ class CI_DB_odbc_driver extends CI_DB {
// --------------------------------------------------------------------
/**
+ * Reconnect
+ *
+ * Keep / reestablish the db connection if no queries have been
+ * sent for a length of time exceeding the server's idle timeout
+ *
+ * @access public
+ * @return void
+ */
+ function reconnect()
+ {
+ // not implemented in odbc
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Select the database
*
* @access private called by the base class
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 4bc5b7d94..db3a3f29d 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -102,6 +102,25 @@ class CI_DB_postgre_driver extends CI_DB {
// --------------------------------------------------------------------
/**
+ * Reconnect
+ *
+ * Keep / reestablish the db connection if no queries have been
+ * sent for a length of time exceeding the server's idle timeout
+ *
+ * @access public
+ * @return void
+ */
+ function reconnect()
+ {
+ if (pg_ping($this->conn_id) === FALSE)
+ {
+ $this->conn_id = FALSE;
+ }
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Select the database
*
* @access private called by the base class
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index bb1e6d02e..cd7b26bc4 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -100,6 +100,22 @@ class CI_DB_sqlite_driver extends CI_DB {
// --------------------------------------------------------------------
/**
+ * Reconnect
+ *
+ * Keep / reestablish the db connection if no queries have been
+ * sent for a length of time exceeding the server's idle timeout
+ *
+ * @access public
+ * @return void
+ */
+ function reconnect()
+ {
+ // not implemented in SQLite
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Select the database
*
* @access private called by the base class