--- parser3/src/main/pa_sql_driver_manager.C 2001/04/05 08:09:24 1.3 +++ parser3/src/main/pa_sql_driver_manager.C 2001/04/05 13:19:43 1.6 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_sql_driver_manager.C,v 1.3 2001/04/05 08:09:24 paf Exp $ + $Id: pa_sql_driver_manager.C,v 1.6 2001/04/05 13:19:43 paf Exp $ */ #include "pa_config_includes.h" @@ -62,11 +62,14 @@ SQL_Connection& SQL_Driver_manager::get_ if(!protocol2library) PTHROW(0, 0, &url, - "SQL:drivers table must be defined"); + "$SQL:drivers table must be defined"); // first trying to get cached connection if(SQL_Connection *result=get_connection_from_cache(url)) - return *result; + if(result->ping()) + return *result; + else + result->disconnect(); // kill unpingabe=dead connection // no cached connection int pos=url.pos("://", 3); @@ -130,11 +133,12 @@ SQL_Connection& SQL_Driver_manager::get_ put_driver_to_cache(protocol, *driver); } - // associate with request + // services associated with request Services_for_SQL_driver_impl& services= *new(pool) Services_for_SQL_driver_impl(pool, url); - // allocate in global pool. associate with services[request] + // allocate in global pool + // associate with services[request], deassociates at close SQL_Connection& result= *new(this->pool()) SQL_Connection(this->pool(), url, *driver, services, url_cstr);