summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1b0247c)
raw | patch | inline | side by side (parent: 1b0247c)
author | Florian Forster <octo@noris.net> | |
Wed, 16 Dec 2009 09:45:54 +0000 (10:45 +0100) | ||
committer | Florian Forster <octo@noris.net> | |
Wed, 16 Dec 2009 09:45:54 +0000 (10:45 +0100) |
src/oracle.c | patch | blob | history |
diff --git a/src/oracle.c b/src/oracle.c
index 78a09ffd048962a05b5054bf51756a88463f37bc..49cf657123b303c4dc292f55dff63a37b02e0dff 100644 (file)
--- a/src/oracle.c
+++ b/src/oracle.c
size_t i;
int status;
+ if (db->oci_service_context != NULL)
+ {
+ OCIServer *server_handle;
+ ub4 connection_status;
+
+ server_handle = NULL;
+ status = OCIAttrGet ((void *) db->oci_service_context, OCI_HTYPE_SVCCTX,
+ (void *) &server_handle, /* size pointer = */ NULL,
+ OCI_ATTR_SERVER, oci_error);
+ if (status != OCI_SUCCESS)
+ {
+ o_report_error ("o_read_database", "OCIAttrGet", oci_error);
+ return (-1);
+ }
+ assert (server_handle != NULL);
+
+ connection_status = 0;
+ status = OCIAttrGet ((void *) server_handle, OCI_HTYPE_SERVER,
+ (void *) &connection_status, /* size pointer = */ NULL,
+ OCI_ATTR_SERVER_STATUS, oci_error);
+ if (status != OCI_SUCCESS)
+ {
+ o_report_error ("o_read_database", "OCIAttrGet", oci_error);
+ return (-1);
+ }
+
+ if (connection_status != OCI_SERVER_NORMAL)
+ {
+ INFO ("oracle plugin: Connection to %s lost. Trying to reconnect.",
+ db->name);
+ OCIHandleFree (db->oci_service_context, OCI_HTYPE_SVCCTX);
+ db->oci_service_context = NULL;
+ }
+ } /* if (db->oci_service_context != NULL) */
+
if (db->oci_service_context == NULL)
{
status = OCILogon (oci_env, oci_error,