|
|
|
|
|
- Overview
- Principle
- Transaction principle for HFSQL Client/Server and HFSQL Classic data files
- Advanced management
- Files created by a transaction
- Organization of files on the server
- Identifier of the computer that performs the transaction
- Errors specific to the management of transactions in HFSQL Client/Server mode
Transactions in HFSQL Client/Server mode
Available only with this kind of connection
To keep maximum compatibility between HFSQL Classic applications (single-user or multi-user) and HFSQL Client/Server applications, the transaction mechanism in HFSQL Client/Server mode is similar to the one in HFSQL Classic mode. This help page presents the differences between the operating modes. Transaction principle for HFSQL Client/Server and HFSQL Classic data files Each write operation performed during a transaction is stored in a transaction file. The transaction can be canceled at any time: all the operations performed since the beginning of transaction will be canceled. The transaction is automatically canceled: - when a fatal error occurs in the program (the application is closed).
- during the call to EndProgram.
- when the test mode is stopped from the editor.
- when a power failure occurs or when the application is shut down unexpectedly.
- when the connection is lost or closed by the client.
- when the server is restarted. Please note: the transaction is not rolled back if it involves a file with a secure password. The transaction will be canceled during the next opening of the data file.
Isolation of transactions The HFSQL engine offers transaction isolation: modifications made in a current transaction are isolated from those made in other transactions running simultaneously, until the transaction is validated. Several isolation levels are available: - "READ UNCOMMITTED": Reading uncommitted data (default mode).
- "READ COMMITTED": Reading committed data.
- "REPEATABLE READ": Photographed transactions
Files created by a transaction When transactions are set up, several types of HFSQL data files are created: - transaction log of operations HFSQL format file containing the various operations performed on application files taken into account by the transaction. This file is created with HTransactionStart (or HTransaction). It is named TRSOPERATION.TRS.
- identification log File containing unique information to identify the transaction (customer name, workstation, etc.). This file is named TRSOperationInfoClient.TRS.
- value log File associated with each data file taken into account by the transaction. This file is named <FileName>.TRX. For each operation performed in the transaction, this file contains:
- the content of the record after the operation (case of a deletion for instance).
- the content of the record after the operation (during an addition for example).
Organization of files on the server | |  | 1. __TRS directory This directory contains:- The log of operations in transaction.
- The identification log
- For each data file in transaction of each database, the corresponding file of values. The tree structure used corresponds to the tree structure of the data files associated with the database.
For example, if the Orders file of DataApplicationA is in transaction, the __TRS\DataApplicationA subdirectory will contain the Orders.TRX file. Another example If the Client file of DonneesApplicationB is put in transaction, the sub-directory __TRS\DonneesApplicationB\Client will contain the file Client.TRX. 2. Database directory DataApplicationA 3. Database directory DataApplicationB |
Identifier of the computer that performs the transaction Identification of the workstation carrying out the transaction is done in the same way in HFSQL Classic and HFSQL Client/Server: by default, the workstation is identified by a unique internal number and by the workstation name (name defined under Windows). To easily identify the computer that performs the operations in transaction, HComputer allows you to define an identifier specific to the computer. This identifier replaces the computer name. This identifier is saved in the log of operations in transaction and it can be consulted via the HFSQL Control Center. The client is identified by: - HComputer (identical to HFSQL Classic).
- Name and IP address of computer.
- Name of the application, that is ExecutableName (ProjectName).
Errors specific to the management of transactions in HFSQL Client/Server mode 74020: Transaction file password does not match original file password The data file (in HFSQL Client/Server mode) and the transaction file do not use the same password. 70032: Isolation mode problem This error can occur in the following cases:
Related Examples:
|
Training (WINDEV): WD Transaction
[ + ] This program, powered by WINDEV, is based on a simplified analysis (ORDERS, ORDERLINE and STOCK). It illustrates the operating mode of the transactions when placing an order.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|