From 42db4f982f0f2e9c0e7461015c5959fb27c1f91c Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 26 Jan 2007 14:03:15 +0000 Subject: [PATCH] child process exit handler git-svn-id: svn://svn.open-ils.org/ILS/trunk@6819 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/c-apps/oils_cstore.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index e8c04922b7..2fe370bfed 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -25,6 +25,7 @@ int osrfAppChildInit(); int osrfAppInitialize(); +void osrfAppChildExit(); int verifyObjectClass ( osrfMethodContext*, jsonObject* ); @@ -68,6 +69,24 @@ jsonObject* jsonNULL = NULL; // /* parse and store the IDL here */ osrfHash* idl; +/* called when this process is about to exit */ +void osrfAppChildExit() { + osrfLogDebug(OSRF_LOG_MARK, "Child is exiting, disconnecting from database..."); + + if (writehandle) { + dbi_conn_query(writehandle, "ROLLBACK;"); + dbi_conn_close(writehandle); + writehandle = NULL; + } + + if (dbhandle) + dbi_conn_close(dbhandle); + + // XXX add cleanup of readHandles whenever that gets used + + return; +} + int osrfAppInitialize() { growing_buffer* method_name; -- 2.11.0