public void Open(IKeyValueDB keyValueDB, bool dispose)
{
if (keyValueDB == null) throw new ArgumentNullException(nameof(keyValueDB));
_keyValueDB = keyValueDB;
_dispose = dispose;
_tableInfoResolver = new TableInfoResolver(keyValueDB, this);
_tablesInfo = new TablesInfo(_tableInfoResolver);
_relationsInfoResolver = new RelationInfoResolver(this);
_relationsInfo = new RelationsInfo(_relationsInfoResolver);
_lastObjId = 0;
using (var tr = _keyValueDB.StartTransaction())
{
tr.SetKeyPrefix(AllObjectsPrefix);
if (tr.FindLastKey())
{
_lastObjId = (long)new KeyValueDBKeyReader(tr).ReadVUInt64();
}
_tablesInfo.LoadTables(LoadTablesEnum(tr));
_relationsInfo.LoadRelations(LoadRelationNamesEnum(tr));
tr.SetKeyPrefix(null);
if (tr.FindExactKey(LastDictIdKey))
{
_lastDictId = new ByteArrayReader(tr.GetValueAsByteArray()).ReadVUInt64();
}
}
}