Struct persy::Recover [−][src]
pub struct Recover { /* fields omitted */ }
Expand description
Intermediate recover status to select witch transactions to commit or rollback and list witch transactions are in a intermediate state
Example
let mut recover = Persy::recover("./target/recover_example.persy", Config::new())?;
for (tx_id,status) in recover.list_transactions() {
// Check the transaction if can be committed using the tx_id
if true {
// if so commit the tx
recover.commit(tx_id);
} else {
// otherwise roll back it
recover.rollback(tx_id);
}
// finalize all the transaction marked to finalize and get a persy instance.
}
let persy = recover.finalize()?;
Implementations
List all the transactions found in the log with the current status
Mark to commit a transaction in the log with state prepared commit
Mark to rollback a transaction that is not yet committed
Read the status of a transaction in the log