summaryrefslogtreecommitdiff
path: root/libodbcpp/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libodbcpp/connection.cpp')
-rw-r--r--libodbcpp/connection.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libodbcpp/connection.cpp b/libodbcpp/connection.cpp
index ad1c2a7..d1c447d 100644
--- a/libodbcpp/connection.cpp
+++ b/libodbcpp/connection.cpp
@@ -95,7 +95,7 @@ ODBC::Connection::~Connection()
}
int
-ODBC::Connection::beginTx()
+ODBC::Connection::beginTx() const
{
SQLRETURN dberr = SQLSetConnectOption(conn, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
if ((dberr != SQL_SUCCESS)) {
@@ -106,7 +106,7 @@ ODBC::Connection::beginTx()
}
int
-ODBC::Connection::commitTx()
+ODBC::Connection::commitTx() const
{
if (txDepth > 0) {
if (txAborted) {
@@ -130,7 +130,7 @@ ODBC::Connection::commitTx()
}
int
-ODBC::Connection::rollbackTx()
+ODBC::Connection::rollbackTx() const
{
if (txDepth > 0) {
txDepth -= 1;
@@ -162,3 +162,9 @@ ODBC::Connection::txIsAborted() const
return txAborted;
}
+bool
+ODBC::Connection::inTx() const
+{
+ return (txDepth > 0);
+}
+