#include "transaction.h" #include "context.h" bool Transaction::m_inTransaction = false; Transaction::Transaction() { if (!Transaction::m_inTransaction) { //m_tr = new odb::transaction(Context::instance().db()->begin()); #ifdef _DEBUG //m_tr->tracer(odb::stderr_tracer); #endif Transaction::m_inTransaction = true; } else { m_tr = nullptr; } } Transaction::~Transaction() { if (m_tr != nullptr) { delete m_tr; Transaction::m_inTransaction = false; } } void Transaction::commit() { if (m_tr != nullptr) { //m_tr->commit(); } }