Loading backends/pgsql.cpp +2 −8 Original line number Diff line number Diff line Loading @@ -27,8 +27,6 @@ #include <mutex> #include <httppp/exception.h> #include <libpq-fe.h> #include <database.h> Loading @@ -42,10 +40,8 @@ namespace dbpp { Postgresql(const char *constr) { _dbconn = PQconnectdb(constr); if (PQstatus(_dbconn) != CONNECTION_OK){ libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Critical] << PQerrorMessage(_dbconn); PQfinish(_dbconn); throw exp; throw PQerrorMessage(_dbconn); } } Loading @@ -58,10 +54,8 @@ namespace dbpp { int pstate=PQresultStatus(pres); if(pstate==PGRES_FATAL_ERROR || pstate==PGRES_BAD_RESPONSE) { libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Critical] << PQerrorMessage(_dbconn); PQclear(pres); throw exp; throw PQerrorMessage(_dbconn); } res.clear(); Loading backends/sqlite.cpp +2 −8 Original line number Diff line number Diff line Loading @@ -28,8 +28,6 @@ #include <iostream> #include <atomic> #include <httppp/exception.h> #include <sqlite3.h> #include <database.h> Loading @@ -44,10 +42,8 @@ namespace dbpp { while( sqllock.exchange(true, std::memory_order_acquire) ); int status=sqlite3_open(constr,&_dbconn); if (status != SQLITE_OK ){ libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Critical] << sqlite3_errmsg(_dbconn); sqlite3_close(_dbconn); throw exp; throw sqlite3_errmsg(_dbconn); } sqllock.store(false); Loading Loading @@ -90,11 +86,9 @@ namespace dbpp { while( ( pcode = sqlite3_step(prep) ) !=SQLITE_DONE ) { if(pcode==SQLITE_ERROR){ libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Critical] << sqlite3_errmsg(_dbconn); delete[] ssql; sqllock.store(false); throw exp; throw sqlite3_errmsg(_dbconn); } if(pcode==SQLITE_ROW){ Loading Loading
backends/pgsql.cpp +2 −8 Original line number Diff line number Diff line Loading @@ -27,8 +27,6 @@ #include <mutex> #include <httppp/exception.h> #include <libpq-fe.h> #include <database.h> Loading @@ -42,10 +40,8 @@ namespace dbpp { Postgresql(const char *constr) { _dbconn = PQconnectdb(constr); if (PQstatus(_dbconn) != CONNECTION_OK){ libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Critical] << PQerrorMessage(_dbconn); PQfinish(_dbconn); throw exp; throw PQerrorMessage(_dbconn); } } Loading @@ -58,10 +54,8 @@ namespace dbpp { int pstate=PQresultStatus(pres); if(pstate==PGRES_FATAL_ERROR || pstate==PGRES_BAD_RESPONSE) { libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Critical] << PQerrorMessage(_dbconn); PQclear(pres); throw exp; throw PQerrorMessage(_dbconn); } res.clear(); Loading
backends/sqlite.cpp +2 −8 Original line number Diff line number Diff line Loading @@ -28,8 +28,6 @@ #include <iostream> #include <atomic> #include <httppp/exception.h> #include <sqlite3.h> #include <database.h> Loading @@ -44,10 +42,8 @@ namespace dbpp { while( sqllock.exchange(true, std::memory_order_acquire) ); int status=sqlite3_open(constr,&_dbconn); if (status != SQLITE_OK ){ libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Critical] << sqlite3_errmsg(_dbconn); sqlite3_close(_dbconn); throw exp; throw sqlite3_errmsg(_dbconn); } sqllock.store(false); Loading Loading @@ -90,11 +86,9 @@ namespace dbpp { while( ( pcode = sqlite3_step(prep) ) !=SQLITE_DONE ) { if(pcode==SQLITE_ERROR){ libhttppp::HTTPException exp; exp[libhttppp::HTTPException::Critical] << sqlite3_errmsg(_dbconn); delete[] ssql; sqllock.store(false); throw exp; throw sqlite3_errmsg(_dbconn); } if(pcode==SQLITE_ROW){ Loading