--- parser3/src/main/pa_sql_driver_manager.C 2001/05/19 15:45:10 1.20 +++ parser3/src/main/pa_sql_driver_manager.C 2001/08/20 13:22:05 1.24 @@ -4,9 +4,8 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - - $Id: pa_sql_driver_manager.C,v 1.20 2001/05/19 15:45:10 parser Exp $ */ +static const char *RCSId="$Id: pa_sql_driver_manager.C,v 1.24 2001/08/20 13:22:05 parser Exp $"; #include "pa_sql_driver_manager.h" #include "ltdl.h" @@ -110,11 +109,7 @@ SQL_Connection& SQL_Driver_manager::get_ protocol2driver_and_client->origin_string(), "driver library column for protocol '%s' is empty", request_protocol_cstr); - if(!(dlopen_file_spec=protocol2driver_and_client->item(2)) || dlopen_file_spec->size()==0) - PTHROW(0, 0, - protocol2driver_and_client->origin_string(), - "client library column for protocol '%s' is empty", - request_protocol_cstr); + dlopen_file_spec=protocol2driver_and_client->item(2); } else PTHROW(0, 0, &request_url, @@ -147,13 +142,17 @@ SQL_Connection& SQL_Driver_manager::get_ driver_api_version, SQL_DRIVER_API_VERSION); // initialise by connecting to sql client dynamic link library - const char *dlopen_file_spec_cstr=dlopen_file_spec->cstr(String::UL_FILE_NAME); + bool specified_dlopen_file_spec=dlopen_file_spec && dlopen_file_spec->size(); + const char *dlopen_file_spec_cstr= + specified_dlopen_file_spec? + dlopen_file_spec->cstr(String::UL_FILE_NAME):0; if(const char *error=driver->initialize( dlopen_file_spec_cstr)) PTHROW(0, 0, library, "driver failed to initialize client library '%s', %s", - dlopen_file_spec_cstr, error); + specified_dlopen_file_spec?dlopen_file_spec_cstr:"unspeciifed", + error); // cache it put_driver_to_cache(global_protocol, *driver); @@ -198,7 +197,7 @@ void SQL_Driver_manager::put_driver_to_c } // connection cache - +/// @todo get rid of memory spending Stack [zeros deep inside got accumulated] SQL_Connection *SQL_Driver_manager::get_connection_from_cache(const String& url) { SYNCHRONIZED;