| 433 | } |
| 434 | |
| 435 | Savepoint* Savepoint::rollback(thread_db* tdbb, Savepoint* prior, bool preserveLocks) |
| 436 | { |
| 437 | // Undo changes made in this savepoint. |
| 438 | // Perform index and BLOB cleanup if needed. |
| 439 | // At the exit savepoint is clear and safe to reuse. |
| 440 | |
| 441 | jrd_tra* const old_tran = tdbb->getTransaction(); |
| 442 | |
| 443 | try |
| 444 | { |
| 445 | DFW_delete_deferred(m_transaction, m_number); |
| 446 | m_flags &= ~SAV_force_dfw; |
| 447 | |
| 448 | AutoSetRestoreFlag<ULONG> verbCleanupFlag(&tdbb->tdbb_flags, TDBB_verb_cleanup, true); |
| 449 | |
| 450 | tdbb->setTransaction(m_transaction); |
| 451 | |
| 452 | while (m_actions) |
| 453 | { |
| 454 | VerbAction* const action = m_actions; |
| 455 | VerbAction* preserveAction = nullptr; |
| 456 | |
| 457 | if (preserveLocks && m_next) |
| 458 | preserveAction = m_next->createAction(action->vct_relation); |
| 459 | |
| 460 | action->undo(tdbb, m_transaction, preserveLocks, preserveAction); |
| 461 | |
| 462 | m_actions = action->vct_next; |
| 463 | action->vct_next = m_freeActions; |
| 464 | m_freeActions = action; |
| 465 | } |
| 466 | |
| 467 | tdbb->setTransaction(old_tran); |
| 468 | } |
| 469 | catch (const Exception& ex) |
| 470 | { |
| 471 | Arg::StatusVector error(ex); |
| 472 | tdbb->setTransaction(old_tran); |
| 473 | m_transaction->tra_flags |= TRA_invalidated; |
| 474 | error.prepend(Arg::Gds(isc_savepoint_backout_err)); |
| 475 | error.raise(); |
| 476 | } |
| 477 | |
| 478 | return release(prior); |
| 479 | } |
| 480 | |
| 481 | Savepoint* Savepoint::rollforward(thread_db* tdbb, Savepoint* prior) |
| 482 | { |
nothing calls this directly
no test coverage detected