9#include <access/xact.h>
16 : owner(::CurrentResourceOwner), commit(commit), name(
"") {
18 ffi_guarded(::BeginInternalSubTransaction)(
nullptr);
21 throw std::runtime_error(
"internal subtransaction already started");
26 : owner(::CurrentResourceOwner), commit(commit), name(name) {
28 ffi_guarded(::BeginInternalSubTransaction)(this->name.c_str());
31 throw std::runtime_error(
"internal subtransaction already started");
38 ffi_guarded(::ReleaseCurrentSubTransaction)();
40 ffi_guarded(::RollbackAndReleaseCurrentSubTransaction)();
42 ::CurrentResourceOwner = owner;
46 ::ResourceOwner owner;
49 static inline std::stack<internal_subtransaction *> txns;