The Language of Transactions - Firebird

It is important to address the features Firebird implements for transactions, yet several transaction-related features are not implemented in dynamic SQL at all, but only through the API. Of the few transaction-related SQL statements available in the DSQL subset, only COMMIT and ROLLBACK are available to every interface. In a book that is deliberately scoped to be neutral about language environments and emphasize the dynamic SQL used for most current-day client application development, this chapter presents some problems for author and reader alike.

So, although this is not a chapter about ESQL or the API, the following topics will, in places, allude to both in a more or less general way to give some appreciation of what passes across the interface when clients talk to servers about transactions.

ESQL

The superset of SQL and SQL-like statements used widely in former times, even before the publication of the API and the introduction of the DSQL subset, offers a fairly standard SET TRANSACTION syntax for configuring and starting transactions. In some forms, it is available in DSQL and it can be used inside the isql utility. It will be a convenient stepping-off point for a general examination of how the API transports the equivalent information.

The API

The API presents a flexible, if exacting, interface environment of complex functions for C and C++ programmers to build client applications with the thinnest possible communication and connectivity layer. A group of API functions implements the equivalent SQL statements relating to transactions, for example, isc_start_transaction() for SET TRANSACTION and isc _commit _transaction() for COMMIT.

The API header file, ibase.h, declares the function prototypes, type definitions for each structure, parameter definitions, and macros that are used by functions. It is deployed with Firebird in the / include directory.

For several object -oriented development environments, such as Object Pascal, Borland C++Builder, Java, PHP, Python, and DBI::Perl, classes and components are available that encapsulate the Firebird API calls relating to transactions comprehensively. Custom drivers for standard SQL database connectivity interfaces—notably ODBC, JDBC, and .NET —similarly surface the API.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Firebird Topics