ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Error cases
  • Handling records during a transaction
  • Transactions and independent HFSQL context
  • OLE DB and Native Connectors
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Validates the current transaction:
Example
MaConnexion1 is Connection
// Début de la transaction sur les fichiers de données associés à la connexion MaConnexion1
MaConnexion1.TransactionStart()
// Code permettant de préparer la commande à ajouter
// ...
WHEN EXCEPTION IN
	// Ajout de la commande
	Commande.Ajoute() 
	// Validation de l'ajout
	MaConnexion1.TransactionEnd()
DO
	// Suppression des lignes de commandes
	MaConnexion1.TransactionCancel()
END
Syntax

Validating a transaction in progress on a connection Hide the details

<Result> = <Connection>.TransactionEnd()
<Result>: Boolean
  • True if the transaction is ended,
  • False if a problem occurs. HErrorInfo returns more details about the error.
Caution: If a global transaction is started, the function does nothing.. The syntax 2 must be used.
<Connection>: Connection variable
Name of the Connection variable that describes the connection to use.

Validating a global transaction in progress Hide the details

<Result> = TransactionEnd()
<Result>: Boolean
  • True if the transaction is ended,
  • False if a problem occurs. HErrorInfo returns more details about the error.
Remarks

Error cases

  • Transaction nesting: it is not possible to nest transactions (i.e. to call function <Connection variable>.TransactionStart or function <Connection variable>.Transaction within a transaction).. In this case, error 70031 occurs.
  • A fatal error is displayed in the following cases:
    • A transaction is started on all the connections while there is at least one connection in transaction.
    • A transaction is started on a connection while a transaction was already started on all the connections.
    • A transaction is started on all the connections while there is at least one connection whose isolation level is not "Read Uncommitted".

Handling records during a transaction

During a transaction, some rules must be complied with when handling the records. For more details, see Transactions: Handling the records during a transaction.

Transactions and independent HFSQL context

When copying a context, if a transaction is in progress on the first context, the new context is not in transaction. You must call <Connection variable>.TransactionStart (or <Connection variable>.Transaction) to start a transaction in the new context.
WINDEVOLE DBNative Connectors (Native Accesses)

OLE DB and Native Connectors

Only syntaxes with connection are taken into account by the Native Connectors (also called Native Accesses) that support transactions. You can also use SQLTransaction.
Component: wd300hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help