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

Method close

src/jrd/extds/ExtDS.cpp:1895–1969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1893}
1894
1895void Statement::close(thread_db* tdbb, bool invalidTran)
1896{
1897 // we must stuff exception if and only if this is the first time it occurs
1898 // once we stuff exception we must punt
1899
1900 const bool wasError = m_error;
1901 bool doPunt = false;
1902
1903 if (isAllocated() && m_active)
1904 {
1905 fb_assert(isAllocated() && m_stmt_selectable);
1906 try {
1907 doClose(tdbb, false);
1908 }
1909 catch (const Exception& ex)
1910 {
1911 if (!doPunt && !wasError)
1912 {
1913 doPunt = true;
1914 ex.stuffException(tdbb->tdbb_status_vector);
1915 }
1916 }
1917 m_active = false;
1918 }
1919
1920 if (m_boundReq) {
1921 unBindFromRequest();
1922 }
1923
1924 if (invalidTran)
1925 m_transaction = NULL;
1926
1927 if (m_transaction && m_transaction->getScope() == traAutonomous)
1928 {
1929 bool commitFailed = false;
1930 if (!m_error)
1931 {
1932 try {
1933 m_transaction->commit(tdbb, false);
1934 }
1935 catch (const Exception& ex)
1936 {
1937 commitFailed = true;
1938 if (!doPunt && !wasError)
1939 {
1940 doPunt = true;
1941 ex.stuffException(tdbb->tdbb_status_vector);
1942 }
1943 }
1944 }
1945
1946 if (m_error || commitFailed)
1947 {
1948 try {
1949 m_transaction->rollback(tdbb, false);
1950 }
1951 catch (const Exception& ex)
1952 {

Callers 4

deleteTransactionMethod · 0.45
clearStatementsMethod · 0.45
getExtBlobMethod · 0.45
putExtBlobMethod · 0.45

Calls 6

ERR_puntFunction · 0.85
getScopeMethod · 0.80
stuffExceptionMethod · 0.45
commitMethod · 0.45
rollbackMethod · 0.45
releaseStatementMethod · 0.45

Tested by

no test coverage detected