| 367 | } |
| 368 | |
| 369 | void InternalTransaction::doRollback(FbStatusVector* status, thread_db* tdbb, bool retain) |
| 370 | { |
| 371 | fb_assert(m_transaction); |
| 372 | |
| 373 | if (m_connection.isBroken()) |
| 374 | { |
| 375 | m_transaction.clear(); |
| 376 | return; |
| 377 | } |
| 378 | |
| 379 | if (m_scope == traCommon && m_IntConnection.isCurrent()) |
| 380 | { |
| 381 | if (!retain) { |
| 382 | m_transaction = NULL; // release and nullify |
| 383 | } |
| 384 | return; |
| 385 | } |
| 386 | |
| 387 | ISC_STATUS err = 0; |
| 388 | { |
| 389 | EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION); |
| 390 | if (retain) |
| 391 | m_transaction->rollbackRetaining(status); |
| 392 | else |
| 393 | m_transaction->rollback(status); |
| 394 | |
| 395 | if (status->getState() & IStatus::STATE_ERRORS) |
| 396 | err = status->getErrors()[1]; |
| 397 | |
| 398 | if (err == isc_cancelled) |
| 399 | { |
| 400 | FbLocalStatus temp; |
| 401 | JAttachment* jAtt = m_IntConnection.getJrdAtt(); |
| 402 | jAtt->cancelOperation(&temp, fb_cancel_disable); |
| 403 | |
| 404 | status->init(); |
| 405 | if (retain) |
| 406 | m_transaction->rollbackRetaining(status); |
| 407 | else |
| 408 | m_transaction->rollback(status); |
| 409 | |
| 410 | err = (status->getState() & IStatus::STATE_ERRORS) ? |
| 411 | status->getErrors()[1] : 0; |
| 412 | |
| 413 | jAtt->cancelOperation(&temp, fb_cancel_enable); |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | if ((!err || err == isc_att_shutdown || err == isc_shutdown) && !retain) |
| 418 | { |
| 419 | m_transaction.clear(); |
| 420 | status->init(); |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | |
| 425 | // InternalStatement |
nothing calls this directly
no test coverage detected