MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / deleteTransaction

Method deleteTransaction

src/jrd/extds/ExtDS.cpp:643–675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643void Connection::deleteTransaction(thread_db* tdbb, Transaction* tran)
644{
645 // Close all active statements in tran context avoiding commit of already
646 // deleted transaction
647 Statement** stmt_ptr = m_statements.begin();
648
649 while (stmt_ptr < m_statements.end())
650 {
651 Statement* stmt = *stmt_ptr;
652 if (stmt->getTransaction() == tran)
653 {
654 if (stmt->isActive())
655 stmt->close(tdbb, true);
656 }
657
658 // close() above could destroy statement and remove it from m_statements
659 if (stmt_ptr < m_statements.end() && *stmt_ptr == stmt)
660 stmt_ptr++;
661 }
662
663 FB_SIZE_T pos;
664 if (m_transactions.find(tran, pos))
665 {
666 m_transactions.remove(pos);
667 delete tran;
668 }
669 else {
670 fb_assert(false);
671 }
672
673 if (!m_used_stmts && m_transactions.getCount() == 0 && !m_deleting)
674 m_provider.releaseConnection(tdbb, *this);
675}
676
677Statement* Connection::createStatement(const string& sql)
678{

Callers 3

commitMethod · 0.80
rollbackMethod · 0.80
getTransactionMethod · 0.80

Calls 9

releaseConnectionMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getTransactionMethod · 0.45
isActiveMethod · 0.45
closeMethod · 0.45
findMethod · 0.45
removeMethod · 0.45
getCountMethod · 0.45

Tested by

no test coverage detected