|
|
| version 1.18, 2001/05/17 18:36:33 | version 1.19, 2001/05/17 18:43:06 |
|---|---|
| Line 203 void SQL_Driver_manager::put_driver_to_c | Line 203 void SQL_Driver_manager::put_driver_to_c |
| SQL_Connection *SQL_Driver_manager::get_connection_from_cache(const String& url) { | SQL_Connection *SQL_Driver_manager::get_connection_from_cache(const String& url) { |
| SYNCHRONIZED; | SYNCHRONIZED; |
| maybe_expire_connection_cache(); | |
| if(Stack *connections=static_cast<Stack *>(connection_cache.get(url))) | if(Stack *connections=static_cast<Stack *>(connection_cache.get(url))) |
| while(connections->top_index()>=0) { // there are cached connections to that 'url' | while(connections->top_index()>=0) { // there are cached connections to that 'url' |
| SQL_Connection *result=static_cast<SQL_Connection *>(connections->pop()); | SQL_Connection *result=static_cast<SQL_Connection *>(connections->pop()); |
| Line 217 void SQL_Driver_manager::put_connection_ | Line 219 void SQL_Driver_manager::put_connection_ |
| SQL_Connection& connection) { | SQL_Connection& connection) { |
| SYNCHRONIZED; | SYNCHRONIZED; |
| maybe_expire_connection_cache(); | |
| Stack *connections=static_cast<Stack *>(connection_cache.get(url)); | Stack *connections=static_cast<Stack *>(connection_cache.get(url)); |
| if(!connections) { // there are no cached connections to that 'url' yet? | if(!connections) { // there are no cached connections to that 'url' yet? |
| connections=NEW Stack(pool()); // NOTE: never freed up! | connections=NEW Stack(pool()); // NOTE: never freed up! |