--- parser3/src/include/pa_sql_connection.h 2002/08/15 10:38:18 1.27 +++ parser3/src/include/pa_sql_connection.h 2003/01/21 15:51:11 1.30 @@ -1,14 +1,14 @@ /** @file Parser: sql fconnection decl. - Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) 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 $"; +static const char* IDENT_SQL_CONNECTION_H="$Date: 2003/01/21 15:51:11 $"; #include "pa_pool.h" #include "pa_sql_driver.h" @@ -17,11 +17,15 @@ static const char* IDENT_SQL_CONNECTION_ // defines /// @see SQL_Driver_services_impl::_throw -#define SQL_CONNECTION_SERVICED_FUNC_GUARDED(actions) \ - if(!fservices || !setjmp(fservices->mark)) { \ - actions; \ - } else \ - fservices->propagate_exception(); +#ifdef PA_WITH_SJLJ_EXCEPTIONS + #define SQL_CONNECTION_SERVICED_FUNC_GUARDED(actions) actions +#else + #define SQL_CONNECTION_SERVICED_FUNC_GUARDED(actions) \ + if(!fservices || !setjmp(fservices->mark)) { \ + actions; \ + } else \ + fservices->propagate_exception(); +#endif /// SQL connection. handy wrapper around low level SQL_Driver class SQL_Connection : public Pooled { @@ -81,10 +85,13 @@ public: handlers) ); } catch(const Exception& e) { // query problem - // give more specific source [were url] - throw Exception("sql.execute", - &source, - "%s", e.comment()); + if(strcmp(e.type(), "sql.connect")==0) { // if it is _throw exception, + // give more specific source [were url] + throw Exception("sql.execute", + &source, + "%s", e.comment()); + } else + /*re*/throw; } }