boolean OCI_TransactionClose ( OCI_Transaction * trans ) { boolean res = OCI_TransactionStop(trans); /* close transaction handle */ if (trans->htr) { OCI_HandleFree((dvoid *)trans->htr, (ub4)OCI_HTYPE_TRANS); } if (trans->con->trs == trans) { trans->con->trs = NULL; } return res; }
OCI_EXPORT boolean OCI_API OCI_DequeueUnsubscribe ( OCI_Dequeue *dequeue ) { boolean res = TRUE; OCI_CHECK_DATABASE_NOTIFY_ENABLED(FALSE); OCI_CHECK_PTR(OCI_IPC_DEQUEUE, dequeue, FALSE); dequeue->callback = NULL; if (dequeue->subhp != NULL) { /* unregister the subscription */ OCI_CALL3 ( res, dequeue->typinf->con->err, OCISubscriptionUnRegister(dequeue->typinf->con->cxt, dequeue->subhp, dequeue->typinf->con->err,(ub4) OCI_DEFAULT) ) /* free OCI handle */ OCI_HandleFree((dvoid *) dequeue->subhp, OCI_HTYPE_SUBSCRIPTION); dequeue->subhp = NULL; } OCI_RESULT(res); return res; }
boolean OCI_PoolClose ( OCI_Pool *pool ) { boolean res = TRUE; OCI_CHECK_PTR(OCI_IPC_POOL, pool, FALSE); /* free all connections */ OCI_ListForEach(pool->cons, (POCI_LIST_FOR_EACH) OCI_ConnectionClose); OCI_ListClear(pool->cons); OCI_ListFree(pool->cons); pool->cons = NULL; if (OCI_LIB_THREADED) { OCI_MutexFree(pool->mutex); } #if OCI_VERSION_COMPILE >= OCI_9_0 if (OCILib.version_runtime >= OCI_9_0) { /* close pool handle */ if (pool->handle != NULL) { if (pool->htype == OCI_HTYPE_CPOOL) { OCI_CALL0 ( res, pool->err, OCIConnectionPoolDestroy(pool->handle, pool->err, (ub4) OCI_DEFAULT) ) } #if OCI_VERSION_COMPILE >= OCI_9_2 else { OCI_CALL0 ( res, pool->err, OCISessionPoolDestroy(pool->handle, pool->err, (ub4) OCI_SPD_FORCE) ) } #endif OCI_HandleFree((void *) pool->handle, (ub4) pool->htype); } #if OCI_VERSION_COMPILE >= OCI_9_2 /* close authentification handle */ if (pool->authp != NULL) { OCI_HandleFree((void *) pool->authp, (ub4) OCI_HTYPE_AUTHINFO); } #endif /* close error handle */ if (pool->err != NULL) { OCI_HandleFree((void *) pool->err, (ub4) OCI_HTYPE_ERROR); } } #endif pool->err = NULL; pool->handle = NULL; pool->authp = NULL; /* free strings */ OCI_FREE(pool->name); OCI_FREE(pool->db); OCI_FREE(pool->user); OCI_FREE(pool->pwd); return res; }