PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Principle
  • Principle of transactions on HFSQL Client/Server files and on HFSQL Classic 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
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
To keep a high compatibility between the HFSQL Classic applications (single-user or multi-user) and the HFSQL Client/Server applications, the mechanism of transactions in HFSQL Client/Server mode is close to the mechanism of transactions in HFSQL Classic mode.
This help page presents the differences between the operating modes.
See The transactions for more details.
AndroidAndroid Widget iPhone/iPadWindows MobileJava The transactions can be used with HFSQL Client/Server data files only.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Principle

Principle of transactions on HFSQL Client/Server files and on HFSQL Classic 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 the transaction will be canceled. Two transactions are actually performed when a transaction is run in HFSQL Client/Server mode:
  • A transaction is performed on the HFSQL Classic data files (single-user or multi-user)
  • A transaction will also be started on any server whose connection is established before or during the transaction.
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. Caution: the transaction is not canceled if a secured password is assigned to the file involved in the transaction. The transaction will be canceled during the next opening of the data file.
Note: The isolation mode used by default is the "READ UNCOMMITED" mode. To ensure the consistency of your data, this operating mode must be taken into account.
Versions 19 and later
Isolation of transactions
The HFSQL engine proposes to isolate the transactions: the modifications performed in a transaction in progress are isolated from the ones performed in the other transactions run simultaneously, until it is validated.
Several isolation modes are available:
  • "READ UNCOMMITTED": Reading the unvalidated data (default mode).
  • "READ COMMITTED": Reading the validated data.
  • "REPEATABLE READ": Snapshot transactions
See Isolation of transactions for more details.
New in version 19
Isolation of transactions
The HFSQL engine proposes to isolate the transactions: the modifications performed in a transaction in progress are isolated from the ones performed in the other transactions run simultaneously, until it is validated.
Several isolation modes are available:
  • "READ UNCOMMITTED": Reading the unvalidated data (default mode).
  • "READ COMMITTED": Reading the validated data.
  • "REPEATABLE READ": Snapshot transactions
See Isolation of transactions for more details.
Isolation of transactions
The HFSQL engine proposes to isolate the transactions: the modifications performed in a transaction in progress are isolated from the ones performed in the other transactions run simultaneously, until it is validated.
Several isolation modes are available:
  • "READ UNCOMMITTED": Reading the unvalidated data (default mode).
  • "READ COMMITTED": Reading the validated data.
  • "REPEATABLE READ": Snapshot transactions
See Isolation of transactions for more details.
Advanced management

Files created by a transaction

Several types of HFSQL data files are created when the transactions are implemented:
  • the log of operations in transaction: File in HFSQL format containing the different operations performed on the application files taken into account by the transaction. This file is created by HTransactionStart. It is named TRSOPERATION.TRS.the log of operations in transaction: File in HFSQL format containing the different operations performed on the application files taken into account by the transaction. This file is created by HTransactionStart (or by HTransaction). It is named TRSOPERATION.TRS.
  • the identification log: File containing information used to identify the transaction (name of the client, computer, ...). This file is named TRSOperationInfoClient.TRS.
  • the log of values: 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 (during a deletion for example).
    • 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 sub-directory will contain the Orders.TRX file.
Another example: if the Customer file of DataApplicationB is in transaction, the __TRS\DataApplicationB\Customer sub-directory will contain the Customer.TRX file.
2. Directory of database DataApplicationA
3. Directory of database DataApplicationB

Identifier of the computer that performs the transaction

The computer that performs the transaction is identified according the same method in HFSQL Classic and in HFSQL Client/Server: By default, the computer is identified by a unique number and by the computer name (defined in Windows).
To easily identify the computer that performs the operations in transaction, HPost 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:
  • HPost (identical to HFSQL Classic).
  • Name and IP address of computer.
  • Name of the application, that is ExecutableName (ProjectName).
This information can be retrieved by HTransactionInterrupted if the transaction is interrupted.

Errors specific to the management of transactions in HFSQL Client/Server mode

74020: The password of the transaction file does not correspond to the password of the source file
The data file (in HFSQL Client/Server mode) and the transaction file do not use the same password.
Versions 19 and later
70032: Problem of isolation mode
This error can occur in the following cases:
New in version 19
70032: Problem of isolation mode
This error can occur in the following cases:
70032: Problem of isolation mode
This error can occur in the following cases:
Related Examples:
WD Transaction 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.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment