--- parser3/src/include/pa_sql_connection.h 2002/02/08 07:27:45 1.22 +++ parser3/src/include/pa_sql_connection.h 2002/08/15 10:38:18 1.27 @@ -2,14 +2,14 @@ Parser: sql fconnection decl. Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) - - $Id: pa_sql_connection.h,v 1.22 2002/02/08 07:27:45 paf Exp $ + Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_SQL_CONNECTION_H #define PA_SQL_CONNECTION_H +static const char* IDENT_SQL_CONNECTION_H="$Date: 2002/08/15 10:38:18 $"; + #include "pa_pool.h" #include "pa_sql_driver.h" #include "pa_sql_driver_manager.h" @@ -72,12 +72,20 @@ public: void query( const char *statement, unsigned long offset, unsigned long limit, - SQL_Driver_query_event_handlers& handlers) { - SQL_CONNECTION_SERVICED_FUNC_GUARDED( - fdriver.query(*fservices, fconnection, - statement, offset, limit, - handlers) - ); + SQL_Driver_query_event_handlers& handlers, + const String& source) { + try { + SQL_CONNECTION_SERVICED_FUNC_GUARDED( + fdriver.query(*fservices, fconnection, + statement, offset, limit, + handlers) + ); + } catch(const Exception& e) { // query problem + // give more specific source [were url] + throw Exception("sql.execute", + &source, + "%s", e.comment()); + } } void mark_to_rollback() { @@ -99,9 +107,10 @@ private: // closing process /// return to cache void close() { - if(marked_to_rollback) + if(marked_to_rollback) { rollback(); - else + marked_to_rollback=false; + } else commit(); SQL_driver_manager->close_connection(furl, *this);