Issues with Oracle

Issues with Oracle

am 20.02.2006 20:22:49 von ERNESTO PENALOZA

--=_Boundary_xejAnUZV0lGabUUA1lR8
Content-Type: message/rfc822
Content-Disposition: attachment;
filename=originalmail.eml

Received: from ccschusmtp01.pdvsa.com (ccschusmtp01 [162.122.5.6])by
metcam82.pdvsa.com (Postfix) with ESMTP id 4078DFABBfor
; Mon, 20 Feb 2006 15:17:43 -0400 (VET)
Received: from zccschu44.pdvsa.com ([162.122.5.39]) by
ccschusmtp01.pdvsa.com (Lotus Domino Release 6.5) with ESMTP id
2006022015225041-72014 ; Mon, 20 Feb 2006 15:22:50 -0400
To: php-db@lists.php.net
Cc: JAIRO FERNANDEZ
Subject: Issues with Oracle
MIME-Version: 1.0
X-Mailer: Lotus Notes Release 6.5.1 January 21, 2004
Message-ID:
From: ERNESTO PENALOZA
Date: Mon, 20 Feb 2006 15:22:49 -0400
X-MIMETrack: Serialize by Router on CCSCHUCOR04/SERVIDORES/PDVSA(Release
6.5.4 HF129|May12, 2005) at 02/20/2006 03:22:50 PM,Serialize complete at
02/20/2006 03:22:50 PM,Itemize by SMTP Server on
CCSCHUSMTP01/SERVIDORES/PDVSA(Release 6.5|September26, 2003) at 02/20/2006
03:22:50 PM,Serialize by Router on CCSCHUSMTP01/SERVIDORES/PDVSA(Release
6.5|September26, 2003) at 02/20/2006 03:22:52 PM,Serialize complete at
02/20/2006 03:22:52 PM
Content-Type: multipart/alternative;
boundary="=_alternative 006A71CF0425711B_="
X-imss-version: 2.032
X-imss-result: Passed
X-imss-scanInfo: M:P L:E SM:0
X-imss-tmaseResult: TT:0 TS:0.0000 TC:00 TRN:0 TV:3.51.1032(14006.000)
X-imss-scores: Clean:99.90000 C:2 M:3 S:5 R:5
X-imss-settings: Baseline:4 C:3 M:4 S:4 R:4 (1.0000 1.0000)

ste es un mensaje de varios componentes en formato MIME.
--=_alternative 006A71CF0425711B_=
Content-Type: text/plain; charset="US-ASCII"

Hi, I'm using Oracle 8i and the propel project as the persistence layer.
In the server is installed Instant Client of ORACLE v10.2. I'm also using
PHP 5.1.2.

The thing here is that after several hours, I got disconnected from Oracle
for configuration reasons, and I get the message (written from propel)
not connected to ORACLE.

According to what I've been reading, I think this happen because PHP
doesn't "know", I mean, PHP hasn't realized that Oracle database dropped
the connection, then PHP continue using the same connection over and over.

Have you noticed that kind of behavior before?. In case you have noticed
that, what is the solution?

I'm copying a piece of the php_info() function of php just in case.

OCI8
OCI8 Support enabled
Revision $Revision: 1.269.2.8 $
Active Persistent Connections 0
Active Connections 0
Oracle Instant Client Version 10.2
Temporary Lob support enabled
Collections support enabled



--=_alternative 006A71CF0425711B_=
Content-Type: text/html; charset="US-ASCII"



Hi, I'm using Oracle 8i and the propel
project as the persistence layer. In the server is installed Instant Client
of ORACLE v10.2. I'm also using PHP 5.1.2.




The thing here is that after several
hours, I got disconnected from Oracle for configuration reasons, and I
get the message (written from propel)  
not
connected to ORACLE
.



According to what I've been reading,
I think this happen because PHP doesn't "know", I mean, PHP hasn't
realized that Oracle database dropped the connection, then PHP continue
using the same connection over and over.




Have you noticed that kind of behavior
before?. In case you have noticed that, what is the solution?




I'm copying a piece of the php_info()
function of php just in case.




OCI8

OCI8 Support          
              enabled


Revision            
            $Revision: 1.269.2.8
$


Active Persistent Connections        
0


Active Connections          
      0


Oracle Instant Client Version        
10.2


Temporary Lob support         enabled


Collections support          
      enabled







--=_alternative 006A71CF0425711B_=--
--=_Boundary_xejAnUZV0lGabUUA1lR8
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

*************** PDVSA=B4S INTERNET E-MAIL USE ***************
This message may contain information solely of the interest of PDVSA or
its businesses. Copying, distribution, disclosure or any use of the
information contained in this transmission is permitted only to
authorized parties. If you have received this e-mail by error, please
destroy it and notify webmaster@pdvsa.com or the sender by reply email.

****** USO DEL CORREO ELECTRONICO DE PDVSA HACIA INTERNET ******
Esta nota puede contener informacion de interes solo para PDVSA o sus
negocios. Solo esta permitida su copia, distribucion o uso a personas
autorizadas. Si recibio esta nota por error, por favor destruyala y
notifique al remitente o a webmaster@pdvsa.com.

--=_Boundary_xejAnUZV0lGabUUA1lR8
Content-Type: text/plain; charset=us-ascii

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--=_Boundary_xejAnUZV0lGabUUA1lR8--

Re: Issues with Oracle

am 20.02.2006 21:35:00 von Luis M Morales C

--=-SzedpA57kOS7Vr7Rf39y
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Creo q tu problema esta con la forma de conexion contra oracle, trata de
usar contexiones persistentes contra la base de datos.

Te anexo una clase que desarrolle y estoy usando desde hace mas de 4
años, quizas te ayude.


En tu servidor local instala el soporte a pear
http://pear.php.net/package/DB y luego ejecutas:

pear install DB

Con esto ya estaras listo para usar la clase. Te anexo un instructivo de
como usarla:

crear un pagina php:

------- index.php ----------


require_once "db.class.php";

$DB = array ();
$DB['type'] = 'oci8';
$DB['host'] = '10.10.1.7';
$DB['server'] = '10.10.1.7';
$DB['user'] = 'scott';
$DB['password'] = 'tiger';
$DB['dbname'] = 'demo';

$db = new mdb;
$q = "select (1+1) from dual";

if($db->db_dbArray($MDB, $q)){
var_dump($db->_db['data'][0]);
echo "


";
}else{
echo $db->_db['debug'];
echo "
";
}

?>
----------------------------


Suerte,

Luis Morales



On Mon, 2006-02-20 at 15:22 -0400, ERNESTO PENALOZA wrote:
> php_info
--
------------------------------------------------------------ ---------------------
Luis Morales
Consultor de Tecnologia
Cel: +(58)416-4242091
------------------------------------------------------------ ---------------------
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
------------------------------------------------------------ ---------------------

--=-SzedpA57kOS7Vr7Rf39y
Content-Disposition: attachment; filename=db.class.php
Content-Type: application/x-php; name=db.class.php
Content-Transfer-Encoding: 7bit

if (!defined("DB")) {
define("DB","1");
require_once( 'DB.php' );

class mdb{
var $_db;

function db_Connect($p){
$db = $p['type'];
$dbhost = $p['host'];
$dbport = $p['port'];
$dbuser = $p['user'];
$dbpass = $p['password'];
$dbname = $p['dbname'];
$dsn = "$db://$dbuser:$dbpass@$dbhost:$dbport/$dbname";

if ( DB::isError( $this->_db['cnx'] = DB::connect( "{$dsn}" ) ) ) {
$this->_db['error']=DB::errorMessage($this->_db['cnx']);
$this->_db['debug']=$this->_db['cnx']->getDebugInfo();
return false;
}else{
return true;
}
}//db_Connect


function db_dbQuery($p,$q){
$out = false;
if($this->db_Connect($p)){
if(DB::isError($result = $this->_db['cnx']->query($q))){
$this->_db['error']=DB::errorMessage($result);
$this->_db['debug']=$result->getDebugInfo();
}else{
$out = true;
}
$this->db_Disconnect();
}

return $out;
}//db_dbQuery


function db_dbArray($p,$q){
$out = false;
if($this->db_Connect($p)){
if(DB::isError( $result = $this->_db['cnx']->query($q))) {
$this->_db['error']=DB::errorMessage($result);
$this->_db['debug']=$result->getDebugInfo();
}else{
while ($row =& $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$this->_db['data'][]=$row;
}
$out = true;
}
$this->db_Disconnect();
}
return $out;
}//dbQueryArray

function db_Disconnect(){
if ( DB::isError($this->_db['cnx']->disconnect()) ) {
$this->_db['error']=DB::errorMessage($this->_db['cnx']);
return false;
}else{
return true;
}
}//db_Disconnect

}//class mdb


}//DB

/*******************************************/
/* LICENSE: LGPL */
/* AUTHOR: Luis Morales */
/* EMAIL: lmorales@venezuelasite.net */
/* BLOG: fastonion.blogspot.com */
/*******************************************/
?>


--=-SzedpA57kOS7Vr7Rf39y
Content-Type: text/plain; charset=us-ascii

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--=-SzedpA57kOS7Vr7Rf39y--