Skip to content

Commit 72d2065

Browse files
committed
Transaction test the rollback function
We as well perform the necessary fix.
1 parent d570626 commit 72d2065

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

include/sqlpp23/core/database/transaction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class transaction_t {
8383

8484
void rollback() {
8585
_finished = true;
86-
_db.rollback_transaction(false);
86+
_db.rollback_transaction();
8787
}
8888
};
8989

tests/postgresql/usage/Transaction.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ int Transaction(int, char*[]) {
6060

6161
tx.commit();
6262
require_equal(__LINE__, db.is_transaction_active(), false);
63+
auto tx2 = start_transaction(db, sqlpp::isolation_level::serializable);
64+
require_equal(__LINE__, db.is_transaction_active(), true);
65+
tx2.rollback();
66+
require_equal(__LINE__, db.is_transaction_active(), false);
6367
}
6468

6569
require_equal(__LINE__, db.get_default_isolation_level(),

0 commit comments

Comments
 (0)