Add some logs
This commit is contained in:
parent
701105fb64
commit
6df0f0020c
|
@ -24,6 +24,7 @@ PgTransactionImpl::PgTransactionImpl(const PgConnectionPtr &connPtr,
|
||||||
}
|
}
|
||||||
PgTransactionImpl::~PgTransactionImpl()
|
PgTransactionImpl::~PgTransactionImpl()
|
||||||
{
|
{
|
||||||
|
LOG_TRACE << "Destruct";
|
||||||
assert(!_isWorking);
|
assert(!_isWorking);
|
||||||
if (!_isCommitedOrRolledback)
|
if (!_isCommitedOrRolledback)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,20 +36,15 @@ int main()
|
||||||
{
|
{
|
||||||
auto trans = client->newTransaction();
|
auto trans = client->newTransaction();
|
||||||
*trans << "delete from users where user_uuid=201" >>
|
*trans << "delete from users where user_uuid=201" >>
|
||||||
[](const Result &r) {
|
[trans](const Result &r) {
|
||||||
std::cout << "delete " << r.affectedRows() << "user!!!!!" << std::endl;
|
std::cout << "delete " << r.affectedRows() << "user!!!!!" << std::endl;
|
||||||
|
trans->rollback();
|
||||||
} >>
|
} >>
|
||||||
[](const DrogonDbException &e) {
|
[](const DrogonDbException &e) {
|
||||||
std::cout << e.base().what() << std::endl;
|
std::cout << e.base().what() << std::endl;
|
||||||
};
|
};
|
||||||
*trans << "dlelf from users" >>
|
|
||||||
[](const Result &r) {
|
*trans << "delete from users where user_uuid=201" >>
|
||||||
std::cout << "delete " << r.affectedRows() << "user!!!!!" << std::endl;
|
|
||||||
} >>
|
|
||||||
[](const DrogonDbException &e) {
|
|
||||||
std::cout << e.base().what() << std::endl;
|
|
||||||
};
|
|
||||||
*trans << "dlelf111 from users" >>
|
|
||||||
[](const Result &r) {
|
[](const Result &r) {
|
||||||
std::cout << "delete " << r.affectedRows() << "user!!!!!" << std::endl;
|
std::cout << "delete " << r.affectedRows() << "user!!!!!" << std::endl;
|
||||||
} >>
|
} >>
|
||||||
|
@ -57,6 +52,7 @@ int main()
|
||||||
std::cout << e.base().what() << std::endl;
|
std::cout << e.base().what() << std::endl;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Mapper<User> mapper(client);
|
Mapper<User> mapper(client);
|
||||||
auto U = mapper.findByPrimaryKey(2);
|
auto U = mapper.findByPrimaryKey(2);
|
||||||
std::cout << "id=" << U._userId << std::endl;
|
std::cout << "id=" << U._userId << std::endl;
|
||||||
|
|
Loading…
Reference in New Issue