7 m_session(session),m_locallyActive(
false){
12 m_session.transaction().rollback();
17 if(m_locallyActive)
return -1;
18 int ret = m_session.transaction().start( readOnly );
19 m_locallyActive =
true;
24 if(!m_locallyActive)
return -1;
25 int ret = m_session.transaction().commit();
26 m_locallyActive =
false;
31 if(!m_locallyActive)
return false;
32 bool ret = m_session.transaction().rollback();
33 m_locallyActive =
false;
38 return m_locallyActive;
42 return m_session.transaction().isActive();
47 return m_session.transaction().isReadOnly();
bool rollback()
rollback transaction
DbScopedTransaction(cond::DbSession &session)
bool isReadOnly() const
current transaction is readonly
int isActive() const
current transaction is active
int start(bool readOnly=false)
start transaction
bool isLocallyActive() const
query if locally has been activated
int commit()
commit transaction. Will disconnect from database if connection timeout==0 or connectted time close t...