Advantage Developer Zone

 
 
 

Using Advantage Transaction Processing with Delphi Applications

Friday, July 14, 2006

The Advantage Database Server provides the powerful features of a Transaction Processing System (TPS) for your Advantage applications. Advantage TPS allows an application to perform multiple append and update operations to any number of tables with complete confidence that either all of the append and update operations will be successful or that none of the operations will occur. Advantage TPS processes multiple appends and updates as though they are a single, atomic operation.

Advantage Transaction Processing was aligned with the existing Delphi scheme as much as possible. The Advantage TAdsConnection component has encapsulated Advantage Transaction Processing in the Advantage TDataSet Descendant solution. Use the TAdsConnection component to perform transaction processing with the Advantage TDataSet Descendant solution. The TAdsConnection methods and property applicable to transaction processing are:

TAdsConnection.BeginTransaction

Begins a transaction for all tables associated with the instance of TAdsConnection.

TAdsConnection.Rollback

Aborts a transaction. Any updates, deletes, and inserts issued since the transaction began will be aborted.

TAdsConnection.Commit

Commits the changes since the transaction began.

TAdsConnection.TransactionActive

Boolean property to indicate if a transaction is active.

Example Application

For an example of how to use Advantage Transaction Processing with your Delphi application, visit the download area of the Advantage Developer Zone Web Site and click on the Delphi directory. Locate the file in this directory called ads_delphi_examples.exe. The Delphi examples are shipped with the source code so that our customers can compile and modify this application as they see fit. In addition to a Transaction Processing example, there are also examples of how to do filters, FindKey, and other useful examples that will allow the developer to optimize their applications.