AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Gestión de transacciones
  • Overview
  • What is a transaction?
  • Using the transactions according to your requirements
  • Principle
  • Principle of transactions on HFSQL data files
  • Special cases
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
What is a transaction?
A transaction is a set of indissociable operations: either all the operations in the transaction are performed, or none are 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:
  • Performing transactions in applications installed on reliable computers (surge protector, only one application running, etc.): 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, ...).
    Transactions ensure 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 executed during the transaction must not display windows, browse data files, ... This code should only include data file modification operations.
    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 transaction will be canceled.
Once the write operations included in the transaction are completed, the program can validate the operations of the transaction.
Remarks:
  • HFSQL Classic The transaction isolation level used is "READ UNCOMMITED".
  • HFSQL Client/Server The transaction isolation level is defined with HTransactionIsolation. The default isolation level is the "READ UNCOMMITED" mode.

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, the transaction is cancelled.
  • Restarting the server cancels the current transactions. Please note: the transaction is not rolled back if it involves a data file with a secure password. The transaction will be canceled during the next opening of the data file.
For more details, see Managing special cases.
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 18/06/2025

Señalar un error o enviar una sugerencia | Ayuda local