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

Method doRollback

src/jrd/extds/IscDS.cpp:404–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402}
403
404void IscTransaction::doRollback(FbStatusVector* status, thread_db* tdbb, bool retain)
405{
406 EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION);
407 if (retain)
408 m_iscProvider.isc_rollback_retaining(status, &m_handle);
409 else
410 m_iscProvider.isc_rollback_transaction(status, &m_handle);
411
412 if ((status->getState() & IStatus::STATE_ERRORS) &&
413 (status->getErrors()[1] == isc_cancelled))
414 {
415 FbLocalStatus temp;
416 FB_API_HANDLE db = m_iscConnection.getAPIHandle();
417 m_iscProvider.fb_cancel_operation(&temp, &db, fb_cancel_disable);
418
419 status->init();
420 if (retain)
421 m_iscProvider.isc_rollback_retaining(status, &m_handle);
422 else
423 m_iscProvider.isc_rollback_transaction(status, &m_handle);
424
425 m_iscProvider.fb_cancel_operation(&temp, &db, fb_cancel_enable);
426 }
427
428 if ((status->getState() & IStatus::STATE_ERRORS) &&
429 isConnectionBrokenError(status) && !retain)
430 {
431 m_handle = 0;
432 fb_utils::init_status(status);
433 }
434
435 fb_assert(retain && m_handle || !retain && !m_handle ||
436 (status->getState() & IStatus::STATE_ERRORS) && m_handle);
437}
438
439
440// IscStatement

Callers

nothing calls this directly

Calls 8

isConnectionBrokenErrorFunction · 0.85
init_statusFunction · 0.85
fb_cancel_operationMethod · 0.80
getStateMethod · 0.45
getErrorsMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected