--- parser3/src/include/pa_sql_driver_manager.h 2003/03/13 12:34:21 1.26.2.9 +++ parser3/src/include/pa_sql_driver_manager.h 2003/12/11 09:25:50 1.30 @@ -9,9 +9,9 @@ #ifndef PA_SQL_DRIVER_MANAGER_H #define PA_SQL_DRIVER_MANAGER_H -static const char* IDENT_SQL_DRIVER_MANAGER_H="$Date: 2003/03/13 12:34:21 $"; +static const char * const IDENT_SQL_DRIVER_MANAGER_H="$Date: 2003/12/11 09:25:50 $"; + -#include "pa_pool.h" #include "pa_sql_driver.h" #include "pa_hash.h" #include "pa_table.h" @@ -26,21 +26,21 @@ static const char* IDENT_SQL_DRIVER_MANA // forwards -class SQL_Connection; DECLARE_OBJECT_PTR (SQL_Connection); +class SQL_Connection; /// sql driver manager class SQL_Driver_manager: public Cache_manager { public: - typedef Hash driver_cache_type; - typedef Hash > > connection_cache_type; + typedef Hash driver_cache_type; + typedef Stack connection_cache_element_base_type; + typedef Hash connection_cache_type; private: friend class SQL_Connection; bool is_dlinited; - Pool driver_cache_pool; driver_cache_type driver_cache; connection_cache_type connection_cache; @@ -54,8 +54,7 @@ public: using driver dynamic library found in table, if not loaded yet checks driver version */ - SQL_ConnectionPtr get_connection(Pool& pool, StringPtr arequest_url, StringPtr aorigin, - Table *protocol2driver_and_client); + SQL_Connection* get_connection(const String& aurl, Table *protocol2driver_and_client); private: // driver cache @@ -64,9 +63,9 @@ private: // driver cache private: // connection cache - SQL_ConnectionPtr get_connection_from_cache(connection_cache_type::key_type url); + SQL_Connection* get_connection_from_cache(connection_cache_type::key_type url); void put_connection_to_cache(connection_cache_type::key_type url, - SQL_ConnectionPtr connection); + SQL_Connection* connection); private: time_t prev_expiration_pass_time; @@ -74,16 +73,16 @@ private: // for SQL_Connection /// caches connection void close_connection(connection_cache_type::key_type url, - SQL_ConnectionPtr connection); + SQL_Connection* connection); public: // Cache_manager - override ValuePtr get_status(Pool& pool, StringPtr source); + override Value* get_status(); override void maybe_expire_cache(); }; /// global -extern SQL_Driver_manager SQL_driver_manager; +extern SQL_Driver_manager* SQL_driver_manager; #endif