|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch make_resuming_pdo_oci_sessions for PDO OCI Bug #55768Patch version 2011-09-26 08:31 UTC Return to Bug #55768 | Download this patchThis patch is obsolete Obsoleted by patches: This patch renders other patches obsolete Obsolete patches: Patch Revisions:
Developer: mikhail.v.gavrilov@gmail.com
Index: oci_driver.c
===================================================================
--- oci_driver.c (revision 317201)
+++ oci_driver.c (working copy)
@@ -515,6 +515,22 @@
}
/* }}} */
+static int pdo_oci_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_oci_db_handle *H = (pdo_oci_db_handle *)dbh->driver_data;
+#if ((OCI_MAJOR_VERSION > 10) || ((OCI_MAJOR_VERSION == 10) && (OCI_MINOR_VERSION >= 2))) /* OCIPing available 10.2 onwards */
+ H->last_err = OCIPing (H->svc, H->err, OCI_DEFAULT);
+#else
+ char version[256];
+ /* use good old OCIServerVersion() */
+ H->last_err = OCIServerVersion (H->svc, H->err, (text *)version, sizeof(version), OCI_HTYPE_SVCCTX);
+#endif
+ if (H->last_err == OCI_SUCCESS) {
+ return SUCCESS;
+ }
+ return FAILURE;
+}
+/* }}} */
static struct pdo_dbh_methods oci_methods = {
oci_handle_closer,
@@ -528,7 +544,7 @@
NULL,
pdo_oci_fetch_error_func,
oci_handle_get_attribute,
- NULL, /* check_liveness */
+ pdo_oci_check_liveness, /* check_liveness */
NULL /* get_driver_methods */
};
|
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 04:00:01 2025 UTC |