CVS update: php3/functions

From: Date: Sat, 29 May 1999 10:12:49 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-6238@lists.php.net to get a copy of this message
Date: Saturday May 29, 1999 @ 6:12 Author: thies Update of /repository/php3/functions In directory php:/tmp/cvs-serv30563/functions Modified Files: oracle.c oracle.h Log Message: see changelog Index: php3/functions/oracle.c diff -u php3/functions/oracle.c:1.105 php3/functions/oracle.c:1.106 --- php3/functions/oracle.c:1.105 Tue May 18 04:45:20 1999 +++ php3/functions/oracle.c Sat May 29 06:12:49 1999 @@ -239,6 +239,7 @@ static int _close_oracur(oraCursor *cur) { int i; + ORACLE_TLS_VARS; if (cur){ if (cur->query){ @@ -258,7 +259,27 @@ cur->columns = NULL; } if (cur->open){ - oclose(&cur->cda); + oraConnection *db_conn; + int alive = 0, type; + + /* 1st check if our connection is still there */ + + db_conn = (oraConnection *)php3_list_do_find(ORACLE_GLOBAL(php3_oracle_module).list,cur->conn_id, &type); + if (db_conn && (type == ORACLE_GLOBAL(php3_oracle_module).le_conn)) { + alive = 1; + } + + if (! alive) { + db_conn = (oraConnection *)php3_list_do_find(ORACLE_GLOBAL(php3_oracle_module).plist,cur->conn_id, &type); + if (db_conn && (type == ORACLE_GLOBAL(php3_oracle_module).le_pconn)) { + alive = 1; + } + } + + if (alive) { + oclose(&cur->cda); + } + cur->open = 0; } efree(cur); @@ -420,10 +441,9 @@ int hashed_len, len, id; ORACLE_TLS_VARS; - /* - ORACLE_GLOBAL(php3_oracle_module).resource_list = list; - ORACLE_GLOBAL(php3_oracle_module).resource_plist = plist; - */ + /* we need those for shutdown */ + ORACLE_GLOBAL(php3_oracle_module).list = list; + ORACLE_GLOBAL(php3_oracle_module).plist = plist; if (getParameters(ht, 2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; @@ -627,6 +647,7 @@ } cursor->open = 1; cursor->conn_ptr = conn; + cursor->conn_id = conn_ind; RETURN_LONG(ora_add_cursor(list, cursor)); } /* }}} */ @@ -1036,6 +1057,7 @@ } cursor->open = 1; cursor->conn_ptr = conn; + cursor->conn_id = argv[0]->value.lval; /* Prepare stmt */ Index: php3/functions/oracle.h diff -u php3/functions/oracle.h:1.38 php3/functions/oracle.h:1.39 --- php3/functions/oracle.h:1.38 Thu May 6 03:58:38 1999 +++ php3/functions/oracle.h Sat May 29 06:12:49 1999 @@ -1,4 +1,4 @@ -/* $Id: oracle.h,v 1.38 1999/05/06 07:58:38 thies Exp $ */ +/* $Id: oracle.h,v 1.39 1999/05/29 10:12:49 thies Exp $ */ #ifndef _PHP3_ORACLE_H #define _PHP3_ORACLE_H @@ -94,6 +94,7 @@ int ncols; int fetched; oraConnection *conn_ptr; + int conn_id; } oraCursor; typedef struct { @@ -106,6 +107,8 @@ long num_persistent; long num_links; int le_conn, le_pconn, le_cursor; + HashTable *list; + HashTable *plist; } oracle_module; extern void php3_Ora_Bind(INTERNAL_FUNCTION_PARAMETERS); -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#6238) next »