From b4825d95472f8d9e2b9892a56c585a035b6230ac 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/database.ixx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'odb/database.ixx') diff --git a/odb/database.ixx b/odb/database.ixx index 378a376..a15bb7d 100644 --- a/odb/database.ixx +++ b/odb/database.ixx @@ -11,10 +11,7 @@ namespace odb { inline database:: database (database_id id) - : id_ (id), - tracer_ (0), - default_schema_version_ (0), - schema_version_seq_ (1) + : id_ (id), tracer_ (0), schema_version_seq_ (1) { } @@ -36,16 +33,6 @@ namespace odb return schema_version_migration (name).migration; } - inline const database::schema_version_migration_type& database:: - schema_version_migration (const std::string& name) const - { - return name.empty () && - default_schema_version_ != 0 && - default_schema_version_->version != 0 - ? *default_schema_version_ - : schema_version_migration_ (name); - } - inline void database:: schema_version_migration (schema_version_type v, bool m, -- cgit v1.1