aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/statement.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-10-15 13:17:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-10-19 11:40:30 +0200
commit8112bd0febcfa1e3a76e0d03363facbefc3822f7 (patch)
tree0f5a05b9b29ae7d77e95f7831c214b385aaf6a3b /odb/sqlite/statement.cxx
parentd94948b8bccfd8748245726487d54c41bb199baf (diff)
Implement early connection release
Diffstat (limited to 'odb/sqlite/statement.cxx')
-rw-r--r--odb/sqlite/statement.cxx41
1 files changed, 10 insertions, 31 deletions
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
{