From f355b8ede7e1e1ce80289b007ffb380197061979 Mon Sep 17 00:00:00 2001 From: Jirka Chadima Date: Tue, 28 Aug 2012 11:05:40 +0200 Subject: [PATCH] Allow forcing a persistent connection via driver configuration --- dibi/drivers/oracle.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dibi/drivers/oracle.php b/dibi/drivers/oracle.php index 242d28cc..93d6603b 100644 --- a/dibi/drivers/oracle.php +++ b/dibi/drivers/oracle.php @@ -21,6 +21,7 @@ * - formatDate => how to format date in SQL (@see date) * - formatDateTime => how to format datetime in SQL (@see date) * - resource (resource) => existing connection resource + * - persistent => Creates persistent connections with oci_pconnect instead of oci_new_connect * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @author David Grudl @@ -70,8 +71,10 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri if (isset($config['resource'])) { $this->connection = $config['resource']; - } else { + } elseif (empty($config['persistent'])) { $this->connection = @oci_new_connect($config['username'], $config['password'], $config['database'], $config['charset']); // intentionally @ + } else { + $this->connection = @oci_pconnect($config['username'], $config['password'], $config['database'], $config['charset']); // intentionally @ } if (!$this->connection) {