summaryrefslogtreecommitdiff
path: root/lib/dbConn.cpp
blob: 380910add5735b0bad149699e0168a362560f2e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "dbConn.h"

namespace MyGrate {
	Tx::Tx(DbConn * c) : conn {c}
	{
		conn->beginTx();
	}

	Tx::~Tx()
	{
		if (std::uncaught_exceptions()) {
			conn->rollbackTx();
		}
		else {
			conn->commitTx();
		}
	}
}