mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-08 18:52:50 -06:00
transactions should always start with the last revision and release it when done
This commit is contained in:
@@ -260,7 +260,7 @@ public:
|
||||
return node->right;
|
||||
} else {
|
||||
ref<Node> left = pop_first(node->left, res);
|
||||
ref<Node> node = upd_node(node, left, node->right);
|
||||
node = upd_node(node, left, node->right);
|
||||
return balanceR(node);
|
||||
}
|
||||
}
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
return node->left;
|
||||
} else {
|
||||
ref<Node> right = pop_last(node->right, res);
|
||||
ref<Node> node = upd_node(node, node->left, right);
|
||||
node = upd_node(node, node->left, right);
|
||||
return balanceL(node);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1057,13 +1057,12 @@ void pgf_check_type(PgfDB *db, PgfRevision revision,
|
||||
}
|
||||
|
||||
PGF_API
|
||||
PgfRevision pgf_start_transaction(PgfDB *db, PgfRevision revision,
|
||||
PgfExn *err)
|
||||
PgfRevision pgf_start_transaction(PgfDB *db, PgfExn *err)
|
||||
{
|
||||
PGF_API_BEGIN {
|
||||
DB_scope scope(db, WRITER_SCOPE);
|
||||
|
||||
ref<PgfPGF> pgf = db->revision2pgf(revision);
|
||||
ref<PgfPGF> pgf = db->get_active_revision();
|
||||
|
||||
db->start_transaction();
|
||||
|
||||
@@ -1079,6 +1078,8 @@ PgfRevision pgf_start_transaction(PgfDB *db, PgfRevision revision,
|
||||
|
||||
object rev = db->register_revision(new_pgf.tagged(), PgfDB::get_txn_id());
|
||||
|
||||
PgfDB::free(pgf);
|
||||
|
||||
db->ref_count++;
|
||||
return rev;
|
||||
} PGF_API_END
|
||||
|
||||
@@ -462,8 +462,7 @@ void pgf_check_type(PgfDB *db, PgfRevision revision,
|
||||
PgfExn *err);
|
||||
|
||||
PGF_API_DECL
|
||||
PgfRevision pgf_start_transaction(PgfDB *db, PgfRevision revision,
|
||||
PgfExn *err);
|
||||
PgfRevision pgf_start_transaction(PgfDB *db, PgfExn *err);
|
||||
|
||||
PGF_API_DECL
|
||||
void pgf_commit_transaction(PgfDB *db, PgfRevision revision,
|
||||
|
||||
Reference in New Issue
Block a user