| 1716 | |
| 1717 | public: |
| 1718 | void RunThinkPart() |
| 1719 | { |
| 1720 | if (!success_ && !failure_) |
| 1721 | return; |
| 1722 | |
| 1723 | if (Succeeded() && success_) |
| 1724 | { |
| 1725 | if (CallSuccess()) |
| 1726 | return; |
| 1727 | } |
| 1728 | |
| 1729 | if (!Succeeded() && failure_) |
| 1730 | { |
| 1731 | HandleSecurity sec(ident_, g_pCoreIdent); |
| 1732 | |
| 1733 | std::unique_ptr<cell_t[]> data = std::make_unique<cell_t[]>(txn_->entries.size()); |
| 1734 | for (size_t i = 0; i < txn_->entries.size(); i++) |
| 1735 | data[i] = txn_->entries[i].data; |
| 1736 | |
| 1737 | Handle_t dbh = CreateLocalHandle(g_DBMan.GetDatabaseType(), db_, &sec); |
| 1738 | if (dbh != BAD_HANDLE) |
| 1739 | { |
| 1740 | // Add an extra refcount for the handle. |
| 1741 | db_->AddRef(); |
| 1742 | } |
| 1743 | |
| 1744 | if (failure_->IsRunnable()) |
| 1745 | { |
| 1746 | failure_->PushCell(dbh); |
| 1747 | failure_->PushCell(data_); |
| 1748 | failure_->PushCell(txn_->entries.size()); |
| 1749 | failure_->PushString(error_.c_str()); |
| 1750 | failure_->PushCell(failIndex_); |
| 1751 | failure_->PushArray(data.get(), txn_->entries.size()); |
| 1752 | failure_->Execute(NULL); |
| 1753 | } |
| 1754 | |
| 1755 | handlesys->FreeHandle(dbh, &sec); |
| 1756 | } |
| 1757 | } |
| 1758 | |
| 1759 | private: |
| 1760 | ke::RefPtr<IDatabase> db_; |
nothing calls this directly
no test coverage detected