Transaction db tables action

These patches replace a macro to start transaction with the new style of this project, which can be written C++ friendly.