我试图打开之前创建的两个数据库。创建它们的程序崩溃,并使事务处于打开状态。当我尝试打开数据库时,它会在&t; txn-> commit(0)中死锁;'语句:
auto envFlags = DB_CREATE |
DB_INIT_LOCK |
DB_INIT_LOG |
DB_INIT_MPOOL |
DB_INIT_TXN;
dbEnv.open(dbHomePath.c_str(), envFlags, 0);
DbTxn *txn;
dbEnv.txn_begin(NULL, &txn, 0);
dbActive.open(txn, "db0.db", NULL, DB_BTREE, DB_CREATE, 0);
dbClosed.open(txn, "db1.db", NULL, DB_BTREE, DB_CREATE, 0);
txn->commit(0);
如何取消未完成的交易?