From 9d3cbeb69565d7c005856f1d156d8552241a7bc1 Mon Sep 17 00:00:00 2001 From: Eloy Lafuente Date: Sun, 8 Nov 2009 23:13:31 +0000 Subject: [PATCH] MDL-17491 oracle connections - fix annoyance when multiple connections are used and enforce new connections by using oci_new_connect() --- lib/dml/oci_native_moodle_database.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index e9c5c408fe..e2b52d5f30 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -180,19 +180,20 @@ class oci_native_moodle_database extends moodle_database { $pass = addcslashes($this->dbpass, "'\\"); if (empty($this->dbhost)) { - // old style full address + // old style full address (TNS) + $dbstring = $this->dbname; } else { if (empty($this->dboptions['dbport'])) { $this->dboptions['dbport'] = 1521; } - $this->dbname = '//'.$this->dbhost.':'.$this->dboptions['dbport'].'/'.$this->dbname; + $dbstring = '//'.$this->dbhost.':'.$this->dboptions['dbport'].'/'.$this->dbname; } ob_start(); if (empty($this->dboptions['dbpersit'])) { - $this->oci = oci_connect($this->dbuser, $this->dbpass, $this->dbname, 'AL32UTF8'); + $this->oci = oci_new_connect($this->dbuser, $this->dbpass, $dbstring, 'AL32UTF8'); } else { - $this->oci = oci_pconnect($this->dbuser, $this->dbpass, $this->dbname, 'AL32UTF8'); + $this->oci = oci_pconnect($this->dbuser, $this->dbpass, $dbstring, 'AL32UTF8'); } $dberr = ob_get_contents(); ob_end_clean(); -- 2.39.5