CVS update: php3/functions

From: Date: Mon, 19 Apr 1999 13:43:15 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-5137@lists.php.net to get a copy of this message
Date: Monday April 19, 1999 @ 9:43 Author: thies Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv13230/functions Modified Files: oci8.c php3_oci8.h Log Message: major rework of resource stuff - hopefully "good" now Index: php3/functions/oci8.c diff -c php3/functions/oci8.c:1.78 php3/functions/oci8.c:1.79 *** php3/functions/oci8.c:1.78 Thu Apr 15 16:47:41 1999 --- php3/functions/oci8.c Mon Apr 19 09:43:14 1999 *************** *** 33,42 **** #define OCI8_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */ ! /* $Id: oci8.c,v 1.78 1999/04/15 20:47:41 thies Exp $ */ /* TODO list: * * - Error mode (print or shut up?) * - returning refcursors as statement handles * - OCIPasswordChange() --- 33,44 ---- #define OCI8_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */ ! /* $Id: oci8.c,v 1.79 1999/04/19 13:43:14 thies Exp $ */ /* TODO list: * + * - Commit/Rollback testing..... + * - php.ini flags * - Error mode (print or shut up?) * - returning refcursors as statement handles * - OCIPasswordChange() *************** *** 48,58 **** * - piecewise operation for longs, lobs etc * - split the module into an upper (php-callable) and lower (c-callable) layer! * - make_pval needs some cleanup.... - * - persistend connections * - NULLS (retcode/indicator) needs some more work for describing & binding * - remove all XXXs * - clean up and documentation - * - OCINewContext function. * - there seems to be a bug in OCI where it returns ORA-01406 (value truncated) - whereby it isn't (search for 01406 in the source) * this seems to happen for NUMBER values only... * - make OCIInternalDebug accept a mask of flags.... --- 50,58 ---- *************** *** 166,176 **** static void _oci8_close_conn(oci8_connection *connection); static void _oci8_free_stmt(oci8_statement *statement); static void _oci8_free_column(oci8_out_column *column); - static void _oci8_close_server(oci8_server *server); - static void _oci8_close_user(oci8_session *session); static void _oci8_free_descr(oci8_descriptor *descr); ! static oci8_connection *oci8_get_conn(int, const char *, HashTable *, HashTable *); static oci8_statement *oci8_get_stmt(int, const char *, HashTable *); static oci8_out_column *oci8_get_col(oci8_statement *, int, pval *, char *); --- 166,174 ---- static void _oci8_close_conn(oci8_connection *connection); static void _oci8_free_stmt(oci8_statement *statement); static void _oci8_free_column(oci8_out_column *column); static void _oci8_free_descr(oci8_descriptor *descr); ! static oci8_connection *oci8_get_conn(int, const char *, HashTable *); static oci8_statement *oci8_get_stmt(int, const char *, HashTable *); static oci8_out_column *oci8_get_col(oci8_statement *, int, pval *, char *); *************** *** 181,189 **** static ub4 oci8_loaddesc(oci8_connection *, oci8_descriptor *, char **); static void oci8_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent); - static oci8_server *oci8_open_server(char *dbname,int persistent,HashTable *list, HashTable *plist); - static oci8_session *oci8_login(oci8_server* server,char *username,char *password,int persistent,HashTable *list, HashTable *plist); /* bind callback functions */ static sb4 oci8_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, dvoid **); --- 179,192 ---- static ub4 oci8_loaddesc(oci8_connection *, oci8_descriptor *, char **); static void oci8_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent); + /* ServerAttach/Detach */ + static oci8_server *oci8_open_server(char *dbname,int persistent); + static void _oci8_close_server(oci8_server *server); + + /* SessionBegin/End */ + static oci8_session *oci8_open_user(oci8_server* server,char *username,char *password,int persistent); + static void _oci8_close_user(oci8_session *session); /* bind callback functions */ static sb4 oci8_bind_in_callback(dvoid *, OCIBind *, ub4, ub4, dvoid **, ub4 *, ub1 *, dvoid **); *************** *** 287,293 **** CONST dvoid *ocimalloc(dvoid *ctx, size_t size) { dvoid *ret; ! ret = (dvoid *)emalloc(size); oci8_debug("ocimalloc(%d) = %08x", size,ret); return ret; } --- 290,296 ---- CONST dvoid *ocimalloc(dvoid *ctx, size_t size) { dvoid *ret; ! ret = (dvoid *)malloc(size); oci8_debug("ocimalloc(%d) = %08x", size,ret); return ret; } *************** *** 296,309 **** { dvoid *ret; oci8_debug("ocirealloc(%08x, %d)", ptr, size); ! ret = (dvoid *)erealloc(ptr, size); return ptr; } CONST void ocifree(dvoid *ctx, dvoid *ptr) { oci8_debug("ocifree(%08x)", ptr); ! efree(ptr); } #endif --- 299,312 ---- { dvoid *ret; oci8_debug("ocirealloc(%08x, %d)", ptr, size); ! ret = (dvoid *)realloc(ptr, size); return ptr; } CONST void ocifree(dvoid *ctx, dvoid *ptr) { oci8_debug("ocifree(%08x)", ptr); ! free(ptr); } #endif *************** *** 333,338 **** --- 336,342 ---- TlsSetValue(OCI8Tls, (void *) oci8_globals); #endif /* THREAD_SAFE */ + /* XXX NYI if (cfg_get_long("oci8.allow_persistent", &OCI8_GLOBAL(php3_oci8_module).allow_persistent) == FAILURE) { *************** *** 350,355 **** --- 354,360 ---- } OCI8_GLOBAL(php3_oci8_module).num_persistent = 0; + */ OCI8_GLOBAL(php3_oci8_module).user_num = 1000; OCI8_GLOBAL(php3_oci8_module).server_num = 2000; *************** *** 358,367 **** OCI8_GLOBAL(php3_oci8_module).le_stmt = register_list_destructors(_oci8_free_stmt, NULL); OCI8_GLOBAL(php3_oci8_module).user = malloc(sizeof(HashTable)); ! _php3_hash_init(OCI8_GLOBAL(php3_oci8_module).user, 13, NULL,(void (*)(void *)) _oci8_close_user, 1); OCI8_GLOBAL(php3_oci8_module).server = malloc(sizeof(HashTable)); ! _php3_hash_init(OCI8_GLOBAL(php3_oci8_module).server, 13, NULL,(void (*)(void *)) _oci8_close_server, 1); if (cfg_get_long("oci8.debug_mode", &OCI8_GLOBAL(php3_oci8_module).debug_mode) == FAILURE) { --- 363,372 ---- OCI8_GLOBAL(php3_oci8_module).le_stmt = register_list_destructors(_oci8_free_stmt, NULL); OCI8_GLOBAL(php3_oci8_module).user = malloc(sizeof(HashTable)); ! _php3_hash_init(OCI8_GLOBAL(php3_oci8_module).user, 13, NULL, NULL, 1); OCI8_GLOBAL(php3_oci8_module).server = malloc(sizeof(HashTable)); ! _php3_hash_init(OCI8_GLOBAL(php3_oci8_module).server, 13, NULL, NULL, 1); if (cfg_get_long("oci8.debug_mode", &OCI8_GLOBAL(php3_oci8_module).debug_mode) == FAILURE) { *************** *** 421,428 **** --- 426,435 ---- { OCI8_TLS_VARS; + /* XXX NYI OCI8_GLOBAL(php3_oci8_module).num_links = OCI8_GLOBAL(php3_oci8_module).num_persistent; + */ OCI8_GLOBAL(php3_oci8_module).debug_mode = 0; /* start "fresh" */ *************** *** 431,439 **** --- 438,466 ---- return SUCCESS; } + static int _user_pcleanup(oci8_session *session) + { + _oci8_close_user(session); + + return 0; + } + + static int _server_pcleanup(oci8_server *server) + { + _oci8_close_server(server); + + return 0; + } int php3_mshutdown_oci8() { + oci8_debug("php3_mshutdown_oci8"); + + _php3_hash_apply(OCI8_GLOBAL(php3_oci8_module).user,(int (*)(void *))_user_pcleanup); + _php3_hash_apply(OCI8_GLOBAL(php3_oci8_module).server,(int (*)(void *))_server_pcleanup); + + OCIHandleFree((dvoid *) &OCI8_GLOBAL(php3_oci8_module).pEnv, OCI_HTYPE_ENV); + #ifdef THREAD_SAFE oci8_global_struct *oci8_globals; oci8_globals = TlsGetValue(OCI8Tls); *************** *** 452,465 **** --- 479,519 ---- FREE_MUTEX(oci8_mutex); #endif #endif + return SUCCESS; } + static int _user_cleanup(oci8_session *session) + { + if (session->persistent) + return 0; + + _oci8_close_user(session); + + return 0; + } + + static int _server_cleanup(oci8_server *server) + { + if (server->persistent) + return 0; + + _oci8_close_server(server); + return 0; + } + int php3_rshutdown_oci8() { + OCI8_TLS_VARS; + oci8_debug("php3_rshutdown_oci8"); + + _php3_hash_apply(OCI8_GLOBAL(php3_oci8_module).user,(int (*)(void *))_user_cleanup); + _php3_hash_apply(OCI8_GLOBAL(php3_oci8_module).server,(int (*)(void *))_server_cleanup); + /* XXX free all statements, rollback all outstanding transactions */ + return SUCCESS; } *************** *** 495,501 **** static void _oci8_free_column(oci8_out_column *column) { - if (! column) { return; } --- 549,554 ---- *************** *** 531,540 **** return; } ! oci8_debug("_oci8_free_stmt: id=%d last_query=\"%s\" conn=%d", statement->id, ! (statement->last_query?(char*)statement->last_query:"???"), ! statement->conn->id); if (statement->pStmt) { OCIHandleFree(statement->pStmt, OCI_HTYPE_STMT); --- 584,592 ---- return; } ! oci8_debug("_oci8_free_stmt: id=%d last_query=\"%s\"", statement->id, ! (statement->last_query?(char*)statement->last_query:"???")); if (statement->pStmt) { OCIHandleFree(statement->pStmt, OCI_HTYPE_STMT); *************** *** 599,606 **** OCIHandleFree((dvoid *) connection->pError, (ub4) OCI_HTYPE_ERROR); } - _oci8_close_user(connection->session); - efree(connection); } --- 651,656 ---- *************** *** 711,717 **** /* {{{ oci8_get_conn() */ static oci8_connection * ! oci8_get_conn(int conn_ind, const char *func, HashTable *list, HashTable *plist) { int type; oci8_connection *connection; --- 761,767 ---- /* {{{ oci8_get_conn() */ static oci8_connection * ! oci8_get_conn(int conn_ind, const char *func, HashTable *list) { int type; oci8_connection *connection; *************** *** 1496,1505 **** } /* }}} */ ! /* {{{ oci8_login() */ ! static oci8_session *oci8_login(oci8_server* server,char *username,char *password,int persistent,HashTable *list, HashTable *plist) { sword error; oci8_session *session = 0; --- 1546,1555 ---- } /* }}} */ ! /* {{{ oci8_open_user() */ ! static oci8_session *oci8_open_user(oci8_server* server,char *username,char *password,int persistent) { sword error; oci8_session *session = 0; *************** *** 1517,1528 **** but only as pesistent requested connections will be kept between requests! */ ! hashed_details_length = sizeof("oci8_user_")-1 + ! strlen(SAFE_STRING(username))+ strlen(SAFE_STRING(password))+ strlen(SAFE_STRING(server->dbname)); ! hashed_details = (char *) emalloc(hashed_details_length+1); ! sprintf(hashed_details,"oci8_user_%s%s%s", SAFE_STRING(username), SAFE_STRING(password), SAFE_STRING(server->dbname)); --- 1567,1579 ---- but only as pesistent requested connections will be kept between requests! */ ! hashed_details_length = strlen(SAFE_STRING(username))+ strlen(SAFE_STRING(password))+ strlen(SAFE_STRING(server->dbname)); ! ! hashed_details = (char *) malloc(hashed_details_length+1); ! ! sprintf(hashed_details,"%s%s%s", SAFE_STRING(username), SAFE_STRING(password), SAFE_STRING(server->dbname)); *************** *** 1530,1538 **** _php3_hash_find(OCI8_GLOBAL(php3_oci8_module).user, hashed_details, hashed_details_length+1, (void **) &session); if (session) { ! efree(hashed_details); ! session->refcount++; ! oci8_debug("oci8_login persistent sess=%d refcount=%d",session->num,session->refcount); return session; } --- 1581,1587 ---- _php3_hash_find(OCI8_GLOBAL(php3_oci8_module).user, hashed_details, hashed_details_length+1, (void **) &session); if (session) { ! free(hashed_details); return session; } *************** *** 1544,1549 **** --- 1593,1600 ---- session->persistent = persistent; session->server = server; + session->hashed_details = hashed_details; + session->hashed_details_length = hashed_details_length; /* allocate temporary Service Context */ error = OCIHandleAlloc(OCI8_GLOBAL(php3_oci8_module).pEnv, *************** *** 1552,1558 **** 0, NULL); if (error != OCI_SUCCESS) { ! oci8_error(server->pError, "oci8_login: OCIHandleAlloc OCI_HTYPE_SVCCTX", error); goto CLEANUP; } --- 1603,1609 ---- 0, NULL); if (error != OCI_SUCCESS) { ! oci8_error(server->pError, "oci8_open_user: OCIHandleAlloc OCI_HTYPE_SVCCTX", error); goto CLEANUP; } *************** *** 1563,1569 **** 0, NULL); if (error != OCI_SUCCESS) { ! oci8_error(server->pError, "oci8_login: OCIHandleAlloc OCI_HTYPE_ERROR", error); goto CLEANUP; } --- 1614,1620 ---- 0, NULL); if (error != OCI_SUCCESS) { ! oci8_error(server->pError, "oci8_open_user: OCIHandleAlloc OCI_HTYPE_ERROR", error); goto CLEANUP; } *************** *** 1574,1580 **** 0, NULL); if (error != OCI_SUCCESS) { ! oci8_error(server->pError, "oci8_login: OCIHandleAlloc OCI_HTYPE_SESSION", error); goto CLEANUP; } --- 1625,1631 ---- 0, NULL); if (error != OCI_SUCCESS) { ! oci8_error(server->pError, "oci8_open_user: OCIHandleAlloc OCI_HTYPE_SESSION", error); goto CLEANUP; } *************** *** 1586,1592 **** OCI_ATTR_SERVER, session->pError); if (error != OCI_SUCCESS) { ! oci8_error(session->pError, "oci8_login: OCIAttrSet OCI_ATTR_SERVER", error); goto CLEANUP; } --- 1637,1643 ---- OCI_ATTR_SERVER, session->pError); if (error != OCI_SUCCESS) { ! oci8_error(session->pError, "oci8_open_user: OCIAttrSet OCI_ATTR_SERVER", error); goto CLEANUP; } *************** *** 1627,1634 **** /* Free Temporary Service Context */ OCIHandleFree((dvoid *) svchp, (ub4) OCI_HTYPE_SVCCTX); - - session->refcount++; session->num = OCI8_GLOBAL(php3_oci8_module).user_num++; _php3_hash_update(OCI8_GLOBAL(php3_oci8_module).user, --- 1678,1683 ---- *************** *** 1638,1657 **** sizeof(oci8_session), (void **) &session); ! oci8_debug("oci8_login new sess=%d refcount=%d",session->num,session->refcount); - if (hashed_details) { - efree(hashed_details); - } - - session->refcount++; - session->open = 1; - return session; CLEANUP: if (hashed_details) { ! efree(hashed_details); } if (session) { --- 1687,1699 ---- sizeof(oci8_session), (void **) &session); ! oci8_debug("oci8_open_user new sess=%d user=%s",session->num,session->hashed_details); return session; CLEANUP: if (hashed_details) { ! free(hashed_details); } if (session) { *************** *** 1676,1694 **** if (! session) { return; } - - session->refcount--; ! oci8_debug("_oci8_close_user: sess=%d sess-ref=%d conn-ref=%d",session->num,session->refcount,session->server->refcount); - if ((session->refcount != 0) || (session->persistent)) { - return; - } - - session->open = 0; - - oci8_debug("_oci8_close_user: logging-off sess=%d",session->num); - /* Temporary Service Context */ error = OCIHandleAlloc(OCI8_GLOBAL(php3_oci8_module).pEnv, (dvoid **) &svchp, --- 1718,1726 ---- if (! session) { return; } ! oci8_debug("_oci8_close_user: logging-off sess=%d user=%s",session->num,session->hashed_details); /* Temporary Service Context */ error = OCIHandleAlloc(OCI8_GLOBAL(php3_oci8_module).pEnv, (dvoid **) &svchp, *************** *** 1731,1742 **** } OCIHandleFree((dvoid *) svchp, (ub4) OCI_HTYPE_SVCCTX); - OCIHandleFree((dvoid *) session->pSession, (ub4) OCI_HTYPE_SESSION); ! /* ! _oci8_close_server(session->server); ! */ free(session); } --- 1763,1781 ---- } OCIHandleFree((dvoid *) svchp, (ub4) OCI_HTYPE_SVCCTX); ! if (session->pSession) ! OCIHandleFree((dvoid *) session->pSession, (ub4) OCI_HTYPE_SESSION); ! ! if (session->pError) ! OCIHandleFree((dvoid *) session->pError, (ub4) OCI_HTYPE_ERROR); ! ! _php3_hash_del(OCI8_GLOBAL(php3_oci8_module).user,session->hashed_details,session->hashed_details_length+1); + if (session->hashed_details) { + free(session->hashed_details); + } + free(session); } *************** *** 1756,1762 **** /* }}} */ /* {{{ oci8_open_server() */ ! static oci8_server *oci8_open_server(char *dbname,int persistent,HashTable *list, HashTable *plist) { oci8_server *server = 0; sword error; --- 1795,1801 ---- /* }}} */ /* {{{ oci8_open_server() */ ! static oci8_server *oci8_open_server(char *dbname,int persistent) { oci8_server *server = 0; sword error; *************** *** 1773,1788 **** but only as pesistent requested connections will be kept between requests! */ ! hashed_details_length = sizeof("oci8_server_")-1 + strlen(SAFE_STRING((char *)dbname)); ! hashed_details = (char *) emalloc(hashed_details_length+1); ! sprintf(hashed_details,"oci8_server_%s",SAFE_STRING((char *)dbname)); _php3_hash_find(OCI8_GLOBAL(php3_oci8_module).server, hashed_details, hashed_details_length+1, (void **) &server); if (server) { ! efree(hashed_details); ! server->refcount++; ! oci8_debug("oci8_open_server persistent conn=%d refcount=%d (%s)",server->num,server->refcount,server->dbname); return server; } --- 1812,1831 ---- but only as pesistent requested connections will be kept between requests! */ ! hashed_details_length = strlen(SAFE_STRING((char *)dbname)); ! hashed_details = (char *) malloc(hashed_details_length+1); ! sprintf(hashed_details,"%s",SAFE_STRING((char *)dbname)); _php3_hash_find(OCI8_GLOBAL(php3_oci8_module).server, hashed_details, hashed_details_length+1, (void **) &server); if (server) { ! free(hashed_details); ! ! /* if our new users uses this connection persistent, we're keeping it! */ ! if (persistent) { ! server->persistent = persistent; ! } ! return server; } *************** *** 1794,1799 **** --- 1837,1845 ---- server->persistent = persistent; + server->hashed_details = hashed_details; + server->hashed_details_length = hashed_details_length; + strcpy(server->dbname,dbname); OCIHandleAlloc(OCI8_GLOBAL(php3_oci8_module).pEnv, *************** *** 1819,1825 **** goto CLEANUP; } - server->refcount++; server->num = OCI8_GLOBAL(php3_oci8_module).server_num++; _php3_hash_update(OCI8_GLOBAL(php3_oci8_module).server, --- 1865,1870 ---- *************** *** 1829,1848 **** sizeof(oci8_server), (void **) &server); ! oci8_debug("oci8_open_server new conn=%d refcount=%d (%s)",server->num,server->refcount,server->dbname); - if (hashed_details) { - efree(hashed_details); - } - - server->refcount++; - server->open = 1; - return server; CLEANUP: if (hashed_details) { ! efree(hashed_details); } if (server) { --- 1874,1886 ---- sizeof(oci8_server), (void **) &server); ! oci8_debug("oci8_open_server new conn=%d dname=%s",server->num,server->dbname); return server; CLEANUP: if (hashed_details) { ! free(hashed_details); } if (server) { *************** *** 1859,1882 **** static void _oci8_close_server(oci8_server *server) { OCI8_TLS_VARS; if (! server) { return; } ! server->refcount--; ! oci8_debug("_oci8_close_server: conn=%d conn-ref=%d",server->num,server->refcount); ! if ((server->refcount != 0) || (server->persistent)) { ! return; } ! server->open = 0; ! oci8_debug("_oci8_close_server: detaching conn=%d",server->num); free(server); } --- 1897,1935 ---- static void _oci8_close_server(oci8_server *server) { + sword error; OCI8_TLS_VARS; if (! server) { return; } ! oci8_debug("_oci8_close_server: detaching conn=%d dbname=%s",server->num,server->dbname); ! /* XXX close server here */ ! if (server->pServer && server->pError) { ! error = OCIServerDetach(server->pServer, ! server->pError, ! OCI_DEFAULT); ! ! if (error) { ! oci8_error(server->pError, "oci8_close_server OCIServerDetach", error); ! } } ! if (server->pServer) ! OCIHandleFree((dvoid *) server->pServer, (ub4) OCI_HTYPE_SERVER); ! if (server->pError) ! OCIHandleFree((dvoid *) server->pError, (ub4) OCI_HTYPE_ERROR); + _php3_hash_del(OCI8_GLOBAL(php3_oci8_module).server,server->hashed_details,server->hashed_details_length+1); + + if (server->hashed_details) { + free(server->hashed_details); + } + free(server); } *************** *** 1919,1925 **** goto CLEANUP; } ! server = oci8_open_server(dbname,persistent,list,plist); if (! server) { goto CLEANUP; --- 1972,1978 ---- goto CLEANUP; } ! server = oci8_open_server(dbname,persistent); if (! server) { goto CLEANUP; *************** *** 1927,1933 **** persistent = server->persistent; /* if our server-context is not persistent we can't */ ! session = oci8_login(server,username,password,persistent,list,plist); if (! session) { goto CLEANUP; --- 1980,1986 ---- persistent = server->persistent; /* if our server-context is not persistent we can't */ ! session = oci8_open_user(server,username,password,persistent); if (! session) { goto CLEANUP; *************** *** 2206,2212 **** RETURN_FALSE; } ! connection = oci8_get_conn(conn->value.lval, "OCIfreedesc", list, plist); if (connection == NULL) { RETURN_FALSE; } --- 2259,2265 ---- RETURN_FALSE; } ! connection = oci8_get_conn(conn->value.lval, "OCIfreedesc", list); if (connection == NULL) { RETURN_FALSE; } *************** *** 2246,2252 **** RETURN_FALSE; } ! connection = oci8_get_conn(conn->value.lval, "OCIsavedesc", list, plist); if (connection == NULL) { RETURN_FALSE; } --- 2299,2305 ---- RETURN_FALSE; } ! connection = oci8_get_conn(conn->value.lval, "OCIsavedesc", list); if (connection == NULL) { RETURN_FALSE; } *************** *** 2324,2330 **** RETURN_FALSE; } ! connection = oci8_get_conn(conn->value.lval, "OCIsavedesc", list, plist); if (connection == NULL) { RETURN_FALSE; } --- 2377,2383 ---- RETURN_FALSE; } ! connection = oci8_get_conn(conn->value.lval, "OCIsavedesc", list); if (connection == NULL) { RETURN_FALSE; } *************** *** 2384,2390 **** convert_to_long(conn); ! connection = oci8_get_conn(conn->value.lval, "OCINewDescriptor", list, plist); if (connection == NULL) { RETURN_FALSE; } --- 2437,2443 ---- convert_to_long(conn); ! connection = oci8_get_conn(conn->value.lval, "OCINewDescriptor", list); if (connection == NULL) { RETURN_FALSE; } *************** *** 2437,2449 **** } convert_to_long(conn); ! connection = oci8_get_conn(conn->value.lval, "OCIRollback", list, plist); if (connection == NULL) { RETURN_FALSE; } ociresult = OCITransRollback(connection->pServiceContext,connection->pError, (ub4)0); if (ociresult) { oci8_error(connection->pError, "OCIRollback", ociresult); RETURN_FALSE; --- 2490,2504 ---- } convert_to_long(conn); ! connection = oci8_get_conn(conn->value.lval, "OCIRollback", list); if (connection == NULL) { RETURN_FALSE; } ociresult = OCITransRollback(connection->pServiceContext,connection->pError, (ub4)0); + oci8_debug("OCITransRollback=%d",ociresult); + if (ociresult) { oci8_error(connection->pError, "OCIRollback", ociresult); RETURN_FALSE; *************** *** 2469,2475 **** } convert_to_long(conn); ! connection = oci8_get_conn(conn->value.lval, "OCICommit", list, plist); if (connection == NULL) { RETURN_FALSE; } --- 2524,2530 ---- } convert_to_long(conn); ! connection = oci8_get_conn(conn->value.lval, "OCICommit", list); if (connection == NULL) { RETURN_FALSE; } *************** *** 3039,3045 **** convert_to_long(conn); convert_to_string(query); ! connection = oci8_get_conn(conn->value.lval, "OCIParse", list, plist); if (connection == NULL) { RETURN_FALSE; } --- 3094,3100 ---- convert_to_long(conn); convert_to_string(query); ! connection = oci8_get_conn(conn->value.lval, "OCIParse", list); if (connection == NULL) { RETURN_FALSE; } Index: php3/functions/php3_oci8.h diff -c php3/functions/php3_oci8.h:1.38 php3/functions/php3_oci8.h:1.39 *** php3/functions/php3_oci8.h:1.38 Thu Apr 15 16:47:42 1999 --- php3/functions/php3_oci8.h Mon Apr 19 09:43:15 1999 *************** *** 54,61 **** typedef struct { int num; int persistent; ! int refcount; ! int open; char dbname[ 64 ]; OCIError *pError; OCIServer *pServer; --- 54,61 ---- typedef struct { int num; int persistent; ! char *hashed_details; ! int hashed_details_length; char dbname[ 64 ]; OCIError *pError; OCIServer *pServer; *************** *** 64,71 **** typedef struct { int num; int persistent; ! int refcount; ! int open; oci8_server *server; OCIError *pError; OCISession *pSession; --- 64,71 ---- typedef struct { int num; int persistent; ! char *hashed_details; ! int hashed_details_length; oci8_server *server; OCIError *pError; OCISession *pSession; *************** *** 142,152 **** --- 142,154 ---- long debug_mode; + /* XXX NYI long allow_persistent; long max_persistent; long max_links; long num_persistent; long num_links; + */ int le_conn; /* active connections */ int le_stmt; /* active statements */ -- 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 (#5137) next »