From 12aa1b18d99b51e513e9e82c0ed45717d7538ca0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 28 Sep 2013 10:51:12 +0200 Subject: Make schema version access (but not modification) thread-safe Also cache the version in statements so that we don't have to lock the mutex (slow) every time we need to check the version. --- odb/relational/source.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'odb/relational/source.hxx') diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx index d4bc7a8..ac81bdf 100644 --- a/odb/relational/source.hxx +++ b/odb/relational/source.hxx @@ -4820,8 +4820,8 @@ namespace relational if (s.versioned || s.versioned_containers) os << "const schema_version_migration& svm (" << endl - << "esc." << m.name () << ".connection ().database ()." << - "schema_version_migration (" << schema_name << "));" + << "esc." << m.name () << ".version_migration (" << + schema_name << "));" << endl; // Load values, if any. @@ -5097,8 +5097,8 @@ namespace relational if (s.versioned || s.readwrite_versioned_containers) os << "const schema_version_migration& svm (" << endl - << "esc." << m.name () << ".connection ().database ()." << - "schema_version_migration (" << schema_name << "));" + << "esc." << m.name () << ".version_migration (" << + schema_name << "));" << endl; // Update values, if any. -- cgit v1.1