You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
636 B
C++

#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();
}
}