From Firebird 1.5 forward, the transaction ID (TID) of the current transaction (as deduced from the stored transaction state data) is available as a context variable. It is available in DSQL, isql, triggers, and stored procedures. The variable is CURRENT_TRANSACTION.
For example, to get it in a query, you could request this:SELECT CURRENT_TRANSACTION AS TRAN_ID FROM RDB$DATABASE;
To store it in a table:INSERT INTO TASK_LOG (USER_NAME, TRAN_ID, START_TIMESTAMP) VALUES (CURRENT_USER, CURRENT_TRANSACTION, CURRENT_TIMESTAMP);
Firebird 1.0.x does not provide a mechanism for tracking transactions.
Using the TID in Applications
The TID from the server is not the same as the transaction handle that the Firebird client fetches back into your application. It is quite valid to associate a TID with a transaction handle, provided you remember to remap the relationship between TID and handle each time you reuse a handle. Every use of a handle should be atomic in your application.
The TID can be a useful asset for tracking down applications and users responsible for long-running transactions in a system that continually exhibits degrading performance. A completely cyclic tracking routine could record the server timestamps when transactions both start and finish (commit or roll back). In particular, missing finish times will help to find users who habitually use the “reset” button to terminate tasks or application workflows that are failing to commit work in a timely fashion.
Firebird Related Interview Questions
|RDBMS Interview Questions||MySQL Interview Questions|
|Linux Interview Questions||Mac OS X Deployment Interview Questions|
|Windows Administration Interview Questions||Windows Server 2003 Interview Questions|
|SQL Interview Questions||NoSQL Interview Questions|
|Advanced C++ Interview Questions|
Introduction To Client/server Architecture
About Firebird Data Types
Date And Time Types
Blobs And Arrays
From Drawing Board To Database
Creating And Maintaining A Database
Firebird’s Sql Language
Expressions And Predicates
Querying Multiple Tables
Ordered And Aggregated Sets
Overview Of Firebird Transactions In
Programming With Transactions
Introduction To Firebird Programming
Developing Psql Modules
Error Handling And Events
Security In The Operating Environment
Configuration And Special Features
Interactive Sql Utility (isql)
Database Backup And Restore (gbak)
Housekeeping Tool (gfix)
Understanding The Lock Manager
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.