| 1221 | } |
| 1222 | |
| 1223 | int 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 |
no test coverage detected