mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-04 20:20:59 -06:00
Merge pull request #173 from volka/isolation_level
Implemented get/set_default_isolation_level() functions
This commit is contained in:
@@ -207,8 +207,22 @@ int Select(int, char* [])
|
||||
for_each_field(row, to_cerr{});
|
||||
}
|
||||
|
||||
auto transaction = start_transaction(db, sqlpp::isolation_level::read_committed);
|
||||
std::cout << (db._mock_data._last_isolation_level == sqlpp::isolation_level::read_committed) << std::endl;
|
||||
|
||||
{
|
||||
auto transaction = start_transaction(db, sqlpp::isolation_level::read_committed);
|
||||
if (db._mock_data._last_isolation_level != sqlpp::isolation_level::read_committed)
|
||||
{
|
||||
std::cout << "Error: transaction isolation level does not match expected level" << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
db.set_default_isolation_level(sqlpp::isolation_level::read_uncommitted);
|
||||
{
|
||||
auto transaction = start_transaction(db);
|
||||
if (db._mock_data._last_isolation_level != sqlpp::isolation_level::read_uncommitted)
|
||||
{
|
||||
std::cout << "Error: transaction isolation level does not match default level" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user