Function newTransaction


#include <orm_lib/inc/drogon/orm/DbClient.h>

virtual std::shared_ptr< Transaction > newTransaction(const std::function< void(bool)> &commitCallback=nullptr)=0


Create a transaction object.


commitCallback - the callback with which user can get the submitting result, The Boolean type parameter in the callback function indicates whether the transaction was submitted successfully.

The callback only indicates the result of the 'commit' command, which is the last step of the transaction. If the transaction has been automatically or manually rolled back, the callback will never be executed. You can also use the setCommitCallback() method of a transaction object to set the callback.

Mentioned in


Line 178 in orm_lib/inc/drogon/orm/DbClient.h.

Add Discussion as Guest

Log in to DocsForge