--- parser3/src/main/pa_sql_driver_manager.C 2001/07/23 13:59:52 1.23 +++ parser3/src/main/pa_sql_driver_manager.C 2001/08/28 10:43:33 1.29 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: pa_sql_driver_manager.C,v 1.23 2001/07/23 13:59:52 parser Exp $"; +static const char *RCSId="$Id: pa_sql_driver_manager.C,v 1.29 2001/08/28 10:43:33 parser Exp $"; #include "pa_sql_driver_manager.h" #include "ltdl.h" @@ -116,6 +116,11 @@ SQL_Connection& SQL_Driver_manager::get_ "undefined protocol '%s'", request_protocol_cstr); + if(lt_dlinit()) + PTHROW(0, 0, + library, + "prepare to dynamic loading failed, %s", lt_dlerror()); + const char *filename=library->cstr(String::UL_FILE_NAME); lt_dlhandle handle=lt_dlopen(filename); if (!handle) @@ -151,7 +156,7 @@ SQL_Connection& SQL_Driver_manager::get_ PTHROW(0, 0, library, "driver failed to initialize client library '%s', %s", - specified_dlopen_file_spec?dlopen_file_spec_cstr:"unspeciifed", + specified_dlopen_file_spec?dlopen_file_spec_cstr:"unspecifed", error); // cache it @@ -197,7 +202,7 @@ void SQL_Driver_manager::put_driver_to_c } // connection cache - +/// @todo get rid of memory spending Stack [zeros deep inside got accumulated] SQL_Connection *SQL_Driver_manager::get_connection_from_cache(const String& url) { SYNCHRONIZED; @@ -229,7 +234,7 @@ static void expire_connection(Array::Ite SQL_Connection& connection=*static_cast(value); time_t older_dies=reinterpret_cast(info); - if(connection.expired(older_dies)) + if(connection.connected() && connection.expired(older_dies)) connection.disconnect(); } static void expire_connections(const Hash::Key& key, Hash::Val *value, void *info) {