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

Method releaseStatement

src/jrd/extds/ExtDS.cpp:707–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707void Connection::releaseStatement(Jrd::thread_db* tdbb, Statement* stmt)
708{
709 fb_assert(stmt && !stmt->isActive());
710
711 if (stmt->isAllocated() && testFeature(fb_feature_statement_long_life) && m_free_stmts < MAX_CACHED_STMTS)
712 {
713 stmt->m_nextFree = m_freeStatements;
714 m_freeStatements = stmt;
715 m_free_stmts++;
716 }
717 else
718 {
719 FB_SIZE_T pos;
720 if (m_statements.find(stmt, pos))
721 {
722 m_statements.remove(pos);
723 Statement::deleteStatement(tdbb, stmt);
724 }
725 else {
726 fb_assert(false);
727 }
728 }
729
730 m_used_stmts--;
731
732 if (!m_used_stmts && m_transactions.getCount() == 0 && !m_deleting)
733 m_provider.releaseConnection(tdbb, *this);
734}
735
736void Connection::clearTransactions(Jrd::thread_db* tdbb)
737{

Callers 1

closeMethod · 0.45

Calls 6

isAllocatedMethod · 0.80
releaseConnectionMethod · 0.80
isActiveMethod · 0.45
findMethod · 0.45
removeMethod · 0.45
getCountMethod · 0.45

Tested by

no test coverage detected