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

Function limbo_transaction

src/jrd/tra.cpp:2408–2443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2406
2407
2408static int limbo_transaction(thread_db* tdbb, TraNumber id)
2409{
2410/**************************************
2411 *
2412 * l i m b o _ t r a n s a c t i o n
2413 *
2414 **************************************
2415 *
2416 * Functional description
2417 *
2418 * limbo_state is called when reconnecting
2419 * to an existing transaction to assure that
2420 * the transaction is actually in limbo.
2421 * It returns the transaction state.
2422 *
2423 **************************************/
2424 SET_TDBB(tdbb);
2425 Database* dbb = tdbb->getDatabase();
2426 CHECK_DBB(dbb);
2427
2428 const ULONG trans_per_tip = dbb->dbb_page_manager.transPerTIP;
2429
2430 const ULONG page = id / trans_per_tip;
2431 const ULONG number = id % trans_per_tip;
2432
2433 WIN window(DB_PAGE_SPACE, -1);
2434 const tx_inv_page* tip = fetch_inventory_page(tdbb, &window, page, LCK_write);
2435
2436 const ULONG trans_offset = TRANS_OFFSET(number);
2437 const UCHAR* byte = tip->tip_transactions + trans_offset;
2438 const USHORT shift = TRANS_SHIFT(number);
2439 const int state = (*byte >> shift) & TRA_MASK;
2440 CCH_RELEASE(tdbb, &window);
2441
2442 return state;
2443}
2444
2445
2446void jrd_tra::unlinkFromAttachment()

Callers 1

TRA_reconnectFunction · 0.85

Calls 5

SET_TDBBFunction · 0.85
CHECK_DBBFunction · 0.85
fetch_inventory_pageFunction · 0.85
CCH_RELEASEFunction · 0.85
getDatabaseMethod · 0.80

Tested by

no test coverage detected