ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / Managing transactions / WLanguage functions
  • Special cases
  • Handling records during a transaction
  • Transactions and independent HFSQL context
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Transforms all the records "in transaction" into "normal" records if these records do not belong to a transaction currently in progress. If a record found in the specified data file is considered as being in transaction but does not belong to a transaction in progress, it is automatically freed.
Caution: this function is an advanced function. This feature must be used when it is not possible to cancel the transactions that have failed (deleted transaction files for example).
Example
// Libère tous les enregistrements en transaction susceptibles d'être utilisés
HTransactionFree(Client)
Syntax

Freeing a data file Hide the details

<Result> = HTransactionFree([<Data file>])
<Result>: Boolean
  • True if the operation is performed,
  • False if a problem occurred. HErrorInfo returns more details about the error.
<Data file>: Optional character string
Name of the HFSQL Classic or Client/Server data file for which the records in transaction must be freed.
If this parameter is not specified, function HTransactionFree handles the last used data file.

Freeing a record found in a data file Hide the details

<Result> = HTransactionFree([<Data file>, ] <Record number>)
<Result>: Boolean
  • True if the operation is performed,
  • False if a problem occurred. HErrorInfo returns more details about the error.
<Data file>: Optional character string
Name of the HFSQL Classic or HyperFileSQL Client/Server data file for which the record in transaction must be freed.
If this parameter is not specified, function HTransactionFree handles the last used data file.
<Record number>: Integer
Number of the record to be removed.
If this parameter is equal to 0 or to the constant hRecNumCurrent, the function HTransactionFree will handle the current Record.
Remarks

Special cases

  • This function can only be used for the data files in HFSQL format. For all the other types of data files, this function has no effect and it returns True.
  • The records that cannot be read (locked records for example) are ignored.
  • This function can be used to free the transactions performed on data files found in a HFSQL cluster.

Handling records during a transaction

During a transaction, some rules must be complied with when handling the records. For more details, see Transactions: Handling 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 HTransactionStart (or HTransaction) to start a transaction in the new context.
Component: wd270hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help