summaryrefslogtreecommitdiff
path: root/libodbcpp/connection.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-04-02 01:05:25 +0000
committerrandomdan <randomdan@localhost>2010-04-02 01:05:25 +0000
commit1ede41e012f7363a0d2804e70be0f6c772997e82 (patch)
tree86671e425d8f66fa16ce1989dbdc4fac45853295 /libodbcpp/connection.cpp
parentLots of little fixes (diff)
downloadlibdbpp-odbc-1ede41e012f7363a0d2804e70be0f6c772997e82.tar.bz2
libdbpp-odbc-1ede41e012f7363a0d2804e70be0f6c772997e82.tar.xz
libdbpp-odbc-1ede41e012f7363a0d2804e70be0f6c772997e82.zip
lots of gcc warning fixes and a few newbies
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);
+}
+