diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-28 10:51:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-28 10:51:12 +0200 |
commit | b4825d95472f8d9e2b9892a56c585a035b6230ac (patch) | |
tree | 05d7124cc044205160c4bf4c8bcf8a7bf87dc2d4 /odb/database.ixx | |
parent | 2e258ea80deae21b478c6aa8deae50bd24194c11 (diff) |
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.
Diffstat (limited to 'odb/database.ixx')
-rw-r--r-- | odb/database.ixx | 15 |
1 files changed, 1 insertions, 14 deletions
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, |