--- parser3/src/include/pa_sql_connection.h 2003/03/20 08:11:13 1.30.2.7.2.2 +++ parser3/src/include/pa_sql_connection.h 2003/07/24 11:31:21 1.31 @@ -8,7 +8,7 @@ #ifndef PA_SQL_CONNECTION_H #define PA_SQL_CONNECTION_H -static const char* IDENT_SQL_CONNECTION_H="$Date: 2003/03/20 08:11:13 $"; +static const char* IDENT_SQL_CONNECTION_H="$Date: 2003/07/24 11:31:21 $"; #include "pa_sql_driver.h" @@ -29,16 +29,15 @@ static const char* IDENT_SQL_CONNECTION_ /// SQL_Driver_services Pooled implementation class SQL_Driver_services_impl: public SQL_Driver_services { - Pool *fpool; - const String& furl; + const String* furl; Exception fexception; public: - SQL_Driver_services_impl(): fpool(0), furl(0) {} - void set_pool_and_url(Pool *const String& aurl) { fpool=apool; furl=aurl;} + SQL_Driver_services_impl(): furl(0) {} + void set_url(const String& aurl) { furl=&aurl;} - override void *malloc(size_t size) { return fpool->malloc(size); } - override void *calloc(size_t size) { return fpool->calloc(size); } - override void *realloc(void *ptr, size_t size) { return fpool->realloc(ptr, size); } + override void *malloc(size_t size) { return pa_malloc(size); } + override void *malloc_atomic(size_t size) { return pa_malloc_atomic(size); } + override void *realloc(void *ptr, size_t size) { return pa_realloc(ptr, size); } /** normally we can't 'throw' from dynamic library, so @@ -58,8 +57,8 @@ public: #else fexception= #endif - Exception(aexception.type(), - url_without_login(), + Exception(aexception.type(), + &url_without_login(), aexception.comment()); #ifndef PA_WITH_SJLJ_EXCEPTIONS @@ -97,8 +96,11 @@ public: const String& get_url() { return furl; } - void set_pool() { - fservices.set_pool_and_url(pool?furl:0); + void set_url() { + fservices.set_url(furl); + } + void use() { + time_used=time(0); // they started to use at this time } bool expired(time_t older_dies) { return /*!freferences && */time_used