Storage Engine API
mongo::WiredTigerBeginTxnBlock Class Reference

When constructed, this object begins a WiredTiger transaction on the provided session. More...

#include <wiredtiger_begin_transaction_block.h>

Detailed Description

When constructed, this object begins a WiredTiger transaction on the provided session.

The transaction will be rolled back if done() is not called before the object is destructed.

Public Types

enum  IgnorePrepared { IgnorePrepared::kNoIgnore, IgnorePrepared::kIgnore }
 
enum  RoundToOldest { RoundToOldest::kNoRound, RoundToOldest::kRound }
 

Public Member Functions

 WiredTigerBeginTxnBlock (WT_SESSION *session, IgnorePrepared ignorePrepared=IgnorePrepared::kNoIgnore)
 
 WiredTigerBeginTxnBlock (WT_SESSION *session, const char *config)
 
 ~WiredTigerBeginTxnBlock ()
 
Status setTimestamp (Timestamp, RoundToOldest roundToOldest=RoundToOldest::kNoRound)
 Sets the read timestamp on the opened transaction. More...
 
void done ()
 End the begin transaction block. More...
 

Private Attributes

WT_SESSION * _session
 
bool _rollback = false
 

Member Enumeration Documentation

◆ IgnorePrepared

Enumerator
kNoIgnore 
kIgnore 

◆ RoundToOldest

Enumerator
kNoRound 
kRound 

Constructor & Destructor Documentation

◆ WiredTigerBeginTxnBlock() [1/2]

mongo::WiredTigerBeginTxnBlock::WiredTigerBeginTxnBlock ( WT_SESSION *  session,
IgnorePrepared  ignorePrepared = IgnorePrepared::kNoIgnore 
)

◆ WiredTigerBeginTxnBlock() [2/2]

mongo::WiredTigerBeginTxnBlock::WiredTigerBeginTxnBlock ( WT_SESSION *  session,
const char *  config 
)

◆ ~WiredTigerBeginTxnBlock()

mongo::WiredTigerBeginTxnBlock::~WiredTigerBeginTxnBlock ( )

Member Function Documentation

◆ done()

void mongo::WiredTigerBeginTxnBlock::done ( )

End the begin transaction block.

Must be called to ensure the opened transaction is not be rolled back.

◆ setTimestamp()

Status mongo::WiredTigerBeginTxnBlock::setTimestamp ( Timestamp  readTimestamp,
RoundToOldest  roundToOldest = RoundToOldest::kNoRound 
)

Sets the read timestamp on the opened transaction.

Cannot be called after a call to done().

Member Data Documentation

◆ _rollback

bool mongo::WiredTigerBeginTxnBlock::_rollback = false
private

◆ _session

WT_SESSION* mongo::WiredTigerBeginTxnBlock::_session
private

The documentation for this class was generated from the following files: