Wolframe, 0.0.3

Transaction interface. More...

#include <transaction.hpp>

Classes

class  Result
 Result of a single statement execute call: executeStatement( const std::string&, const std::vector<types::Variant>&);. More...
 

Public Member Functions

 Transaction (const std::string &name_, const TransactionExecStatemachineR &stm_)
 Constructor. More...
 
virtual ~Transaction ()
 Destructor. More...
 
const std::string & databaseID () const
 Configured ID of the underlaying database. More...
 
void begin ()
 Begin of a new transaction. More...
 
void commit ()
 Commit of the running transaction. More...
 
void rollback ()
 Rollback of the running transaction. More...
 
void close ()
 Close of the committed or rolled back transaction. More...
 
virtual bool execute (const VmTransactionInput &input, VmTransactionOutput &output)
 Execute a transaction. More...
 
const std::string & name () const
 Get the name of the transaction. More...
 
bool executeStatement (Result &result, const std::string &stm, const std::vector< types::Variant > &params=std::vector< types::Variant >())
 Execute a single statement with result. More...
 
bool executeStatement (const std::string &stm, const std::vector< types::Variant > &params=std::vector< types::Variant >())
 Execute a single statement without result. More...
 
TransactionExecStatemachineexecStatemachine ()
 Get the lower lever database specific execution statemachine of the transaction. More...
 
const DatabaseErrorgetLastError () const
 Get the last error occurred. More...
 

Private Member Functions

 Transaction (const Transaction &)
 

Private Attributes

std::string m_name
 
TransactionExecStatemachineR m_stm
 
DatabaseError m_lastError
 

Detailed Description

Transaction interface.

Constructor & Destructor Documentation

_Wolframe::db::Transaction::Transaction ( const std::string &  name_,
const TransactionExecStatemachineR stm_ 
)
inline

Constructor.

Parameters
[in]name_name of the transaction (for logging purpose only)
[in]stm_database interface needed by the virtual machine to execute the transaction
virtual _Wolframe::db::Transaction::~Transaction ( )
inlinevirtual

Destructor.

_Wolframe::db::Transaction::Transaction ( const Transaction )
inlineprivate

Member Function Documentation

void _Wolframe::db::Transaction::begin ( )

Begin of a new transaction.

void _Wolframe::db::Transaction::close ( )
inline

Close of the committed or rolled back transaction.

void _Wolframe::db::Transaction::commit ( )

Commit of the running transaction.

const std::string& _Wolframe::db::Transaction::databaseID ( ) const
inline

Configured ID of the underlaying database.

TransactionExecStatemachine* _Wolframe::db::Transaction::execStatemachine ( )
inline

Get the lower lever database specific execution statemachine of the transaction.

virtual bool _Wolframe::db::Transaction::execute ( const VmTransactionInput input,
VmTransactionOutput output 
)
virtual

Execute a transaction.

Returns
true if successful, otherwise false (use getLastError to get details)
bool _Wolframe::db::Transaction::executeStatement ( Result result,
const std::string &  stm,
const std::vector< types::Variant > &  params = std::vector< types::Variant >() 
)

Execute a single statement with result.

Returns
true if successful, otherwise false (use getLastError to get details)
bool _Wolframe::db::Transaction::executeStatement ( const std::string &  stm,
const std::vector< types::Variant > &  params = std::vector< types::Variant >() 
)

Execute a single statement without result.

Returns
true if successful, otherwise false (use getLastError to get details)
const DatabaseError* _Wolframe::db::Transaction::getLastError ( ) const
inline

Get the last error occurred.

const std::string& _Wolframe::db::Transaction::name ( ) const
inline

Get the name of the transaction.

void _Wolframe::db::Transaction::rollback ( )

Rollback of the running transaction.

Member Data Documentation

DatabaseError _Wolframe::db::Transaction::m_lastError
private
std::string _Wolframe::db::Transaction::m_name
private
TransactionExecStatemachineR _Wolframe::db::Transaction::m_stm
private

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