--- parser3/src/include/pa_sql_driver_manager.h 2001/05/17 12:51:05 1.5 +++ parser3/src/include/pa_sql_driver_manager.h 2001/09/05 09:02:52 1.8 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_sql_driver_manager.h,v 1.5 2001/05/17 12:51:05 parser Exp $ + $Id: pa_sql_driver_manager.h,v 1.8 2001/09/05 09:02:52 parser Exp $ global sql driver manager, must be thread-safe @@ -22,6 +22,14 @@ #include "pa_table.h" #include "pa_string.h" + +// defines + +#define MAIN_SQL_NAME "SQL" +#define MAIN_SQL_DRIVERS_NAME "drivers" + +// forwards + class SQL_Connection; /// sql driver manager @@ -31,7 +39,8 @@ public: SQL_Driver_manager(Pool& pool) : Pooled(pool), driver_cache(pool), - connection_cache(pool) { + connection_cache(pool), + prev_expiration_pass_time(0) { } /** @@ -50,11 +59,14 @@ private: // connection cache SQL_Connection *get_connection_from_cache(const String& url); void put_connection_to_cache(const String& url, SQL_Connection& connection); + void maybe_expire_connection_cache(); +private: + time_t prev_expiration_pass_time; private: // for SQL_Connection /// caches connection - void close_connection(const String& url, SQL_Connection& connection, Pool& pool); + void close_connection(const String& url, SQL_Connection& connection); private: