From 8112bd0febcfa1e3a76e0d03363facbefc3822f7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 15 Oct 2012 13:17:30 +0200 Subject: Implement early connection release --- odb/sqlite/statement.cxx | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'odb/sqlite/statement.cxx') diff --git a/odb/sqlite/statement.cxx b/odb/sqlite/statement.cxx index ce194ed..09cf994 100644 --- a/odb/sqlite/statement.cxx +++ b/odb/sqlite/statement.cxx @@ -24,22 +24,18 @@ namespace odb statement:: ~statement () { - if (stmt_ != 0) - finilize (); - } - - void statement:: - cached (bool cached) - { - assert (cached); - - if (!cached_) { - if (!active_) - list_remove (); - - cached_ = true; + odb::tracer* t; + if ((t = conn_.transaction_tracer ()) || + (t = conn_.tracer ()) || + (t = conn_.database ().tracer ())) + t->deallocate (conn_, *this); } + + if (next_ != this) + list_remove (); + + stmt_.reset (); } void statement:: @@ -65,8 +61,6 @@ namespace odb prev_ = 0; next_ = this; - list_add (); // Add to the list because we are uncached. - { odb::tracer* t; if ((t = conn_.transaction_tracer ()) || @@ -76,21 +70,6 @@ namespace odb } } - void statement:: - finilize () - { - { - odb::tracer* t; - if ((t = conn_.transaction_tracer ()) || - (t = conn_.tracer ()) || - (t = conn_.database ().tracer ())) - t->deallocate (conn_, *this); - } - - list_remove (); - stmt_.reset (); - } - const char* statement:: text () const { -- cgit v1.1