OpenM++ runtime library (libopenm)
openm::DbExecBase Class Referenceabstract

base class for database connection wrapper More...

Inheritance diagram for openm::DbExecBase:

Public Member Functions

 DbExecBase (const string &i_connectionStr)
 prepare to open new db-connection. More...
 
 ~DbExecBase (void) noexcept
 cleanup connection resources. More...
 
bool isTransaction (void)
 return true in transaction scope. More...
 

Protected Member Functions

bool isTransactionNonOwn (void)
 return true if other thread have active transaction. More...
 
void setTransactionActive (void)
 set transaction ownership status. More...
 
void releaseTransaction (void)
 release transaction: clean active transaction status. More...
 
string strConnProperty (const string &i_key) const
 return string value of connection property by key (case neutral) or empty "" string if key not found. More...
 
bool boolConnProperty (const string &i_key) const
 return true if value of connection property is 'true', 'yes', '1' (case neutral). More...
 
long long longConnProperty (const string &i_key, long i_default) const
 return long value of connection property or default value if key not found (case neutral). More...
 

Static Protected Member Functions

static void runSqlScript (IDbExec *i_dbExec, const string &i_sqlScript)
 parse and execute list of sql statements. More...
 

Protected Attributes

thread::id trxThreadId
 if true then transaction is active
 
NoCaseMap connProps
 connection properties as key+value string pairs (case neutral). More...
 

Detailed Description

base class for database connection wrapper

Constructor & Destructor Documentation

◆ DbExecBase()

DbExecBase::DbExecBase ( const string &  i_connectionStr)

prepare to open new db-connection.

◆ ~DbExecBase()

openm::DbExecBase::~DbExecBase ( void  )
inlinenoexcept

cleanup connection resources.

Member Function Documentation

◆ boolConnProperty()

bool DbExecBase::boolConnProperty ( const string &  i_key) const
protected

return true if value of connection property is 'true', 'yes', '1' (case neutral).

◆ isTransaction()

bool DbExecBase::isTransaction ( void  )

return true in transaction scope.

◆ isTransactionNonOwn()

bool DbExecBase::isTransactionNonOwn ( void  )
protected

return true if other thread have active transaction.

◆ longConnProperty()

long long DbExecBase::longConnProperty ( const string &  i_key,
long  i_default 
) const
protected

return long value of connection property or default value if key not found (case neutral).

◆ releaseTransaction()

void DbExecBase::releaseTransaction ( void  )
protected

release transaction: clean active transaction status.

◆ runSqlScript()

void DbExecBase::runSqlScript ( IDbExec i_dbExec,
const string &  i_sqlScript 
)
staticprotected

parse and execute list of sql statements.

◆ setTransactionActive()

void DbExecBase::setTransactionActive ( void  )
protected

set transaction ownership status.

◆ strConnProperty()

string DbExecBase::strConnProperty ( const string &  i_key) const
protected

return string value of connection property by key (case neutral) or empty "" string if key not found.

Member Data Documentation

◆ connProps

NoCaseMap openm::DbExecBase::connProps
protected

connection properties as key+value string pairs (case neutral).


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