From 9fce9a7250f63a2a3cceeb0aac7b22d5dd7e6915 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Aug 2011 16:10:02 +0200 Subject: Implement uniform handle management across all databases Also use the auto_handle template instead of the raw handle in connection, statement, and result classes. This removes a lot of brittle "exception safety guarantee" code that we had in those classes. --- odb/pgsql/auto-handle.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 odb/pgsql/auto-handle.cxx (limited to 'odb/pgsql/auto-handle.cxx') diff --git a/odb/pgsql/auto-handle.cxx b/odb/pgsql/auto-handle.cxx new file mode 100644 index 0000000..08e3006 --- /dev/null +++ b/odb/pgsql/auto-handle.cxx @@ -0,0 +1,26 @@ +// file : odb/pgsql/auto-handle.cxx +// author : Constantin Michael +// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include + +#include + +namespace odb +{ + namespace pgsql + { + void handle_traits:: + release (PGconn* h) + { + PQfinish (h); + } + + void handle_traits:: + release (PGresult* h) + { + PQclear (h); + } + } +} -- cgit v1.1