--- parser3/src/main/pa_sql_driver_manager.C 2003/04/11 16:05:43 1.69.2.17.2.13 +++ 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/04/11 16:05:43 $"; +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(size_t i=0; i<=stack->top_index(); i++) + for(size_t i=0; itop(); i++) expire_connection(*stack->get(i), older_dies); } @@ -185,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); } @@ -208,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;