PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • What is a transaction?
  • Using the transactions according to your requirements
  • Principle
  • Principle of transactions on HFSQL data files
  • Special cases
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
This chapter presents the following topics:
Versions 17 and later
iPhone/iPad This feature is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This feature is now available for the iPhone/iPad applications.
iPhone/iPad This feature is now available for the iPhone/iPad applications.
AndroidAndroid Widget iPhone/iPadWindows MobileJava The management of transactions is available for the HFSQL Client/Server databases.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
What is a transaction?
A transaction is a set of indissociable operations: either all the operations of the transaction are performed, or none is performed. The management of transactions is the best way to ensure the integrity of a set of indissociable write operations performed on HFSQL data files.
For example, in a banking application, a transfer operation consists in debiting an account to credit another one. These two operations must be managed in a single transaction in order to avoid any incoherence (in case of power outage during the operation for example).

Using the transactions according to your requirements

Depending on your situation, let's see some tips for optimizing the management of transactions in your applications or sites:
  • Perform the transactions in applications installed on reliable computers (surge protector, a single current application, ...): disk transaction
    In this case, the purpose of transactions is to be able to cancel a set of operations. It is possible to display windows in the middle of a transaction, to perform different lengthy processes, ...
    Each operation performed during the transaction is saved in a transaction file. The record used is locked in write mode until the transaction is validated or canceled.
  • Perform trusted write operations in the data files (banking sector, accounting, ...).
    The transactions are used to insure the security of a set of operations. In this case, you must group all the write operations in your code in order to run them in a transaction. The code run during the transaction must display no window, must browse no data file, ... This code must only contain the operations for modifying the data files.
    Each operation performed during the transaction is saved in a transaction file. The record used is locked in write mode until the transaction is validated or canceled.
Principle

Principle of transactions on HFSQL 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 the transaction will be canceled.
Once the write operations included in the transaction are completed, the program can validate the operations of the transaction.
Notes:
  • The transactions follow the SQL 92 standard "READ UNCOMMITED". To ensure the consistency of your data, this operating mode must be taken into account.
  • The transactions are not available for the Hyper File 5.5 data files.
Notes:
  • HFSQL The isolation mode of transactions is the "READ UNCOMMITED" mode.
  • Versions 19 and later
    HFSQL Client/Server The isolation mode of transactions is defined by HTransactionIsolation. The default isolation mode is the "READ UNCOMMITED" mode.
    New in version 19
    HFSQL Client/Server The isolation mode of transactions is defined by HTransactionIsolation. The default isolation mode is the "READ UNCOMMITED" mode.
    HFSQL Client/Server The isolation mode of transactions is defined by HTransactionIsolation. The default isolation mode is the "READ UNCOMMITED" mode.
  • Hyper File 5.5 The transactions are not available for the Hyper File 5.5 data files.

Special cases

  • Error in the program, the transaction is automatically abandoned.
  • Call to EndProgram, the transaction is automatically abandoned.
  • Test canceled from the editor, the transaction is automatically abandoned.
  • Power outage or unexpected stop of the application (application stopped by the task manager for example):
    When the application is restarted, the consistency of the database can be restored:
HFSQL Client/Server Special cases specific to HFSQL Client/Server:
  • If the Client is lost, cancelation of the transaction.
  • Restarting the server cancels the current transactions. Caution: the transaction is not canceled if the transaction applies to a data file with secure password. The transaction will be canceled during the next opening of the data file.
See Managing special cases for more details.
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