--- parser3/src/include/pa_sql_driver_manager.h 2001/05/17 10:12:28 1.4 +++ parser3/src/include/pa_sql_driver_manager.h 2001/09/14 15:41:59 1.9 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_sql_driver_manager.h,v 1.4 2001/05/17 10:12:28 parser Exp $ + $Id: pa_sql_driver_manager.h,v 1.9 2001/09/14 15:41:59 parser Exp $ global sql driver manager, must be thread-safe @@ -22,16 +22,29 @@ #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 +/** sql driver manager + maintains + - driver cache which never expires + - connection cache unused connections got expired +*/ class SQL_Driver_manager : public Pooled { friend SQL_Connection; public: SQL_Driver_manager(Pool& pool) : Pooled(pool), driver_cache(pool), - connection_cache(pool) { + connection_cache(pool), + prev_expiration_pass_time(0) { } /** @@ -50,6 +63,9 @@ 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