mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-11 06:46:03 +00:00
Merge pull request #14 from realm/tg-end-read
End the read transaction after schema init
This commit is contained in:
commit
324818f277
@ -177,6 +177,13 @@ SharedRealm Realm::get_shared_realm(Config config)
|
||||
else {
|
||||
realm->update_schema(std::move(target_schema), target_schema_version);
|
||||
}
|
||||
|
||||
if (!m_config.read_only) {
|
||||
// End the read transaction created to validation/update the
|
||||
// schema to avoid pinning the version even if the user never
|
||||
// actually reads data
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,7 @@ namespace realm {
|
||||
void commit_transaction();
|
||||
void cancel_transaction();
|
||||
bool is_in_transaction() const { return m_in_transaction; }
|
||||
bool is_in_read_transaction() const { return !!m_group; }
|
||||
|
||||
bool refresh();
|
||||
void set_auto_refresh(bool auto_refresh) { m_auto_refresh = auto_refresh; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user