Skip to content

Commit cdfffa3

Browse files
committed
Try throwing an error if no store
1 parent 912ea50 commit cdfffa3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/binding/transaction.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ napi_value Transaction::Commit(napi_env env, napi_callback_info info) {
225225
auto store = txnHandle->boundLogStore.lock();
226226
if (store) {
227227
store->commitFinished(txnHandle->committedPosition, descriptor->db->GetLatestSequenceNumber());
228+
} else {
229+
DEBUG_LOG("%p Transaction::Commit ERROR: Log store not found for transaction %u\n", txnHandle.get(), txnHandle->id);
230+
state->status = rocksdb::Status::Aborted("Log store not found for transaction");
228231
}
229232
}
230233

@@ -235,7 +238,7 @@ napi_value Transaction::Commit(napi_env env, napi_callback_info info) {
235238
} else if (state->status.IsBusy()) {
236239
// clear/delete the previous transaction and create a new transaction so that it can be retried
237240
txnHandle->txn->ClearSnapshot();
238-
//delete txnHandle->txn;
241+
delete txnHandle->txn;
239242
txnHandle->logEntryBatch = nullptr;
240243
txnHandle->createTransaction();
241244
}

0 commit comments

Comments
 (0)