File: README.transaction_at_snapshot.md

package info (click to toggle)
firebird4.0 4.0.6.3221.ds6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,964 kB
  • sloc: ansic: 393,248; cpp: 356,542; sql: 15,263; yacc: 8,713; fortran: 5,645; sh: 5,184; pascal: 3,328; makefile: 1,342; asm: 271; perl: 194; xml: 55; csh: 15; awk: 1
file content (17 lines) | stat: -rw-r--r-- 906 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Transaction at defined snapshot number

With this feature it's possible to create parallel (via different attachments) processes reading consistent data from a database.

For example, a backup process may create multiple threads paralleling reading data from the database.

Or a web service may dispatch distributed sub services paralleling doing some processing.

That is accomplished creating a transaction with `SET TRANSACTION SNAPSHOT [ AT NUMBER <snapshot number> ]` or `isc_tpb_at_snapshot_number <snapshot number length> <snapshot number>`.

The `snapshot number` from the first transaction may be obtained with `RDB$GET_CONTEXT('SYSTEM', 'SNAPSHOT_NUMBER')` or transaction info call with `fb_info_tra_snapshot_number`.

Note that the `snapshot number` passed to the new transaction must be a snapshot of an active transaction.


Author:
    Adriano dos Santos Fernandes <adrianosf at gmail.com>