8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 14:43:03 +01:00
firebird-mirror/doc/README.transaction_at_snapshot.md
Adriano dos Santos Fernandes cfbcbeda3c
Make it possible to start multiple transactions using the same initial transaction snapshot - CORE-6018 (#193)
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 read data from the database.

Also 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.

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.

Also added CORE-6017 - Add transaction info fb_info_tra_snapshot_number.
2019-03-01 16:17:19 -03:00

18 lines
906 B
Markdown

# 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>