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

Function TPC_snapshot_state

src/jrd/tpc.cpp:1223–1247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1221}
1222
1223int TPC_snapshot_state(thread_db* tdbb, TraNumber number)
1224{
1225 TipCache* cache = tdbb->getDatabase()->dbb_tip_cache;
1226
1227 // This function might be called early during database initialization when
1228 // TIP cache does not exist yet.
1229 if (!cache)
1230 return TRA_fetch_state(tdbb, number);
1231
1232 CommitNumber stateCn = cache->snapshotState(tdbb, number);
1233 switch (stateCn)
1234 {
1235 case CN_ACTIVE:
1236 return tra_active;
1237
1238 case CN_LIMBO:
1239 return tra_limbo;
1240
1241 case CN_DEAD:
1242 return tra_dead;
1243
1244 default:
1245 return tra_committed;
1246 }
1247}
1248
1249
1250} // namespace Jrd

Callers 1

TRA_get_stateFunction · 0.85

Calls 3

TRA_fetch_stateFunction · 0.85
getDatabaseMethod · 0.80
snapshotStateMethod · 0.80

Tested by

no test coverage detected