--- parser3/src/main/pa_sql_driver_manager.C 2020/12/10 23:21:09 1.99 +++ parser3/src/main/pa_sql_driver_manager.C 2026/10/27 23:05:00 1.107 @@ -1,8 +1,8 @@ /** @file Parser: sql driver manager implementation. - Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_sql_driver_manager.h" @@ -11,11 +11,12 @@ #include "pa_sql_connection.h" #include "pa_exception.h" #include "pa_common.h" +#include "pa_os.h" #include "pa_vhash.h" #include "pa_vtable.h" #include "pa_charsets.h" -volatile const char * IDENT_PA_SQL_DRIVER_MANAGER_C="$Id: pa_sql_driver_manager.C,v 1.99 2020/12/10 23:21:09 moko Exp $" IDENT_PA_SQL_DRIVER_MANAGER_H IDENT_PA_SQL_CONNECTION_H; +volatile const char * IDENT_PA_SQL_DRIVER_MANAGER_C="$Id: pa_sql_driver_manager.C,v 1.107 2026/10/27 23:05:00 moko Exp $" IDENT_PA_SQL_DRIVER_MANAGER_H IDENT_PA_SQL_CONNECTION_H; // globals @@ -23,7 +24,7 @@ SQL_Driver_manager* SQL_driver_manager=0 // consts -const time_t EXPIRE_UNUSED_CONNECTION_SECONDS=60; +const time_t EXPIRE_UNUSED_CONNECTION_SECONDS=10; const time_t CHECK_EXPIRED_CONNECTIONS_SECONDS=EXPIRE_UNUSED_CONNECTION_SECONDS*2; // helpers @@ -154,7 +155,7 @@ SQL_Connection* SQL_Driver_manager::get_ lt_dlhandle handle=lt_dlopen(filename); if (!handle) { const char* error=lt_dlerror(); - throw Exception(0, library, error ? error : "can not open the module"); + throw Exception(0, library, error ? error : "cannot open the module"); } SQL_Driver_create_func create=(SQL_Driver_create_func)(lt_dlsym(handle, @@ -256,13 +257,13 @@ static void add_connection_to_status_cac row+=&connection.services().url_without_login(); // time time_t time_used=connection.get_time_used(); - row+=new String(pa_strdup(ctime(&time_used))); + row+=new String(pa_strdup(pa_ctime(time_used))); *table+=&row; } } static void add_connections_to_status_cache_table(SQL_Driver_manager::connection_cache_type::key_type /*key*/, SQL_Driver_manager::connection_cache_type::value_type stack, Table* table) { - for(Array_iterator i(*stack); i.has_next(); ) + for(Array_iterator i(*stack); i; ) add_connection_to_status_cache_table(*i.next(), table); }