sptk2 logo
SPTK Home Page
Public Member Functions | List of all members
sptk::Transaction Class Reference

Database Transaction. More...

#include <Transaction.h>

Public Member Functions

 Transaction (const DatabaseConnection &db)
 
 ~Transaction ()
 
 Transaction (const Transaction &)=delete
 
Transactionoperator= (const Transaction &)=delete
 
void begin ()
 
void commit ()
 
void rollback ()
 
bool active () const
 

Detailed Description

Database Transaction.

Allows to begin, commit, and rollback the transaction automatically. If the transaction object is deleted w/o commiting or rolling back the transaction, it rolls back the transaction (if active)

Constructor & Destructor Documentation

◆ Transaction()

sptk::Transaction::Transaction ( const DatabaseConnection &  db)
explicit

Constructor

Parameters
dbDatabaseConnection&, the database to work with

◆ ~Transaction()

sptk::Transaction::~Transaction ( )

Destructor

Member Function Documentation

◆ active()

bool sptk::Transaction::active ( ) const
inline

Is transaction active?

◆ begin()

void sptk::Transaction::begin ( )

Begins the transaction

◆ commit()

void sptk::Transaction::commit ( )

Commits the transaction

◆ rollback()

void sptk::Transaction::rollback ( )

Rolls back the transaction


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

Fri Oct 14 2022 09:58:47: SPTK 5.4.1