From c5f116af8c044883edf44311173a0c6c017b7d59 Mon Sep 17 00:00:00 2001 From: randomdan Date: Thu, 17 Feb 2011 20:42:53 +0000 Subject: Add check function for when a connection is finished with, but you don't want to close it Use prepared statements only for modifications, use fetch instead for selects (doesn't load an entire record set) Support varchar oid --- libpqpp/connection.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libpqpp/connection.h') diff --git a/libpqpp/connection.h b/libpqpp/connection.h index 4b9b28e..b46151d 100644 --- a/libpqpp/connection.h +++ b/libpqpp/connection.h @@ -10,6 +10,7 @@ namespace PQ { Connection(const std::string & info); ~Connection(); + void finish() const; int beginTx() const; int commitTx() const; int rollbackTx() const; @@ -21,7 +22,7 @@ namespace PQ { DB::SelectCommand * newSelectCommand(const std::string & sql) const; DB::ModifyCommand * newModifyCommand(const std::string & sql) const; - void checkResult(PGresult * res, int expected) const; + PGresult * checkResult(PGresult * res, int expected) const; void checkResultFree(PGresult * res, int expected) const; PGconn * conn; @@ -31,6 +32,7 @@ namespace PQ { mutable unsigned int txDepth; mutable unsigned int pstmntNo; + mutable bool rolledback; }; } -- cgit v1.2.3