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

Method getTransaction

src/jrd/extds/ExtDS.cpp:1653–1693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1651}
1652
1653Transaction* Transaction::getTransaction(thread_db* tdbb, Connection* conn, TraScope tra_scope)
1654{
1655 jrd_tra* tran = tdbb->getTransaction();
1656 Transaction* ext_tran = conn->findTransaction(tdbb, tra_scope);
1657
1658 if (!ext_tran)
1659 {
1660 ext_tran = conn->createTransaction();
1661
1662 TraModes traMode = traConcurrency;
1663 if (tran->tra_flags & TRA_read_committed)
1664 {
1665 if (tran->tra_flags & TRA_read_consistency)
1666 traMode = traReadCommitedReadConsistency;
1667 else if (tran->tra_flags & TRA_rec_version)
1668 traMode = traReadCommitedRecVersions;
1669 else
1670 traMode = traReadCommited;
1671 }
1672 else if (tran->tra_flags & TRA_degree3) {
1673 traMode = traConsistency;
1674 }
1675
1676 try {
1677 ext_tran->start(tdbb,
1678 tra_scope,
1679 traMode,
1680 tran->tra_flags & TRA_readonly,
1681 tran->getLockWait() != 0,
1682 -tran->getLockWait()
1683 );
1684 }
1685 catch (const Exception&)
1686 {
1687 conn->deleteTransaction(tdbb, ext_tran);
1688 throw;
1689 }
1690 }
1691
1692 return ext_tran;
1693}
1694
1695void Transaction::detachFromJrdTran()
1696{

Callers 15

lookupRecordMethod · 0.45
doStartMethod · 0.45
deleteTransactionMethod · 0.45
findTransactionMethod · 0.45
startMethod · 0.45
initMethod · 0.45
~EngineCallbackGuardMethod · 0.45
mapDataMethod · 0.45
TraceProcExecuteMethod · 0.45
finishMethod · 0.45
fetchMethod · 0.45
TraceFuncExecuteMethod · 0.45

Calls 5

findTransactionMethod · 0.80
createTransactionMethod · 0.80
getLockWaitMethod · 0.80
deleteTransactionMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected