--- parser3/src/main/pa_sql_driver_manager.C 2003/03/25 15:10:54 1.69.2.17.2.10 +++ parser3/src/main/pa_sql_driver_manager.C 2003/07/24 11:31:24 1.71 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_SQL_DRIVER_MANAGER_C="$Date: 2003/03/25 15:10:54 $"; +static const char* IDENT_SQL_DRIVER_MANAGER_C="$Date: 2003/07/24 11:31:24 $"; #include "pa_sql_driver_manager.h" #include "ltdl.h" @@ -44,11 +44,10 @@ static void expire_connection(SQL_Connec if(connection.connected() && connection.expired(older_dies)) connection.disconnect(); } -static void expire_connections( - SQL_Driver_manager::connection_cache_type::key_type /*key*/, +static void expire_connections(SQL_Driver_manager::connection_cache_type::key_type /*key*/, SQL_Driver_manager::connection_cache_type::value_type stack, time_t older_dies) { - for(int i=0; i<=stack->top_index(); i++) + for(size_t i=0; itop(); i++) expire_connection(*stack->get(i), older_dies); } @@ -109,7 +108,8 @@ SQL_Connection* SQL_Driver_manager::get_ // no cached const String* library=0; const String* dlopen_file_spec=0; - if(protocol2driver_and_client->locate(0, protocol)) { + Table::Action_options options; + if(protocol2driver_and_client->locate(0, protocol, options)) { if(!(library=protocol2driver_and_client->item(1)) || library->length()==0) throw Exception("parser.runtime", 0, @@ -184,7 +184,7 @@ SQL_Connection* SQL_Driver_manager::get_ } void SQL_Driver_manager::close_connection(connection_cache_type::key_type url, - SQL_Connection* connection) { + SQL_Connection* connection) { put_connection_to_cache(url, connection); } @@ -207,12 +207,11 @@ 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( - connection_cache_type::key_type url) { +SQL_Connection* SQL_Driver_manager::get_connection_from_cache(connection_cache_type::key_type url) { SYNCHRONIZED; if(connection_cache_type::value_type connections=connection_cache.get(url)) - while(connections->top_index()>=0) { // there are cached connections to that 'url' + while(!connections->is_empty()) { // there are cached connections to that 'url' SQL_Connection* result=connections->pop(); if(result->connected()) // not expired? return result; @@ -249,7 +248,6 @@ static void add_connection_to_status_cac Table& table=*static_cast(info); if(connection.connected()) { - =table.pool(); Array& row=*new Array(); // url