PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Error cases
  • Handling records during a transaction
  • Transactions and independent HFSQL context
  • OLE DB and Native Connectors
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
Validates the current transaction:
  • the modifications performed on the data file since the start of transaction (HTransactionStart or HTransaction) are validated.
  • the transaction file is deleted (if this transaction is the last transaction in progress for a network application).
  • the records locked in read-only by the transaction are unlocked.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Example
MaConnexion1 is Connection
 
// Début de la transaction sur les fichiers de données associés à la connexion MaConnexion1
HTransactionStart(MaConnexion1)
 
// Code permettant de préparer la commande à ajouter
// ...
 
WHEN EXCEPTION IN
// Ajout de la commande
HAdd(Commande)
// Validation de l'ajout
HTransactionEnd(MaConnexion1)
DO
// Suppression des lignes de commandes
HTransactionCancel(MaConnexion1)
END
// Début de la transaction sur les fichiers de données Commande et LigneCde
HTransactionStart("C:\Temp\Transaction.trs", "Commande,LigneCde,-Client")
 
// Code permettant de préparer la commande à ajouter
// ...
 
WHEN EXCEPTION IN
// Ajout de la commande
HAdd(Commande)
// Validation de l'ajout
HTransactionEnd()
DO
// Suppression des lignes de commandes
HTransactionCancel()
END
Syntax
Versions 19 and later

Validating a transaction in progress on a connection Hide the details

<Result> = HTransactionEnd(<Connection>)
<Result>: Boolean
  • True if the transaction is ended,
  • False if a problem occurred. The HErrorInfo function provides more information about the error.
Caution: The function has no effect if a global transaction is started. The syntax 2 must be used.
<Connection>: Character string or Connection variable
Connection to use. This connection corresponds to: If this parameter corresponds to the hAccessHF7 constant, the transaction will be performed on HFSQL ISAM files.
New in version 19

Validating a transaction in progress on a connection Hide the details

<Result> = HTransactionEnd(<Connection>)
<Result>: Boolean
  • True if the transaction is ended,
  • False if a problem occurred. The HErrorInfo function provides more information about the error.
Caution: The function has no effect if a global transaction is started. The syntax 2 must be used.
<Connection>: Character string or Connection variable
Connection to use. This connection corresponds to: If this parameter corresponds to the hAccessHF7 constant, the transaction will be performed on HFSQL ISAM files.

Validating a transaction in progress on a connection Hide the details

<Result> = HTransactionEnd(<Connection>)
<Result>: Boolean
  • True if the transaction is ended,
  • False if a problem occurred. The HErrorInfo function provides more information about the error.
Caution: The function has no effect if a global transaction is started. The syntax 2 must be used.
<Connection>: Character string or Connection variable
Connection to use. This connection corresponds to: If this parameter corresponds to the hAccessHF7 constant, the transaction will be performed on HFSQL ISAM files.

Validating a global transaction in progress Hide the details

<Result> = HTransactionEnd()
<Result>: Boolean
  • True if the transaction is ended,
  • False if a problem occurred. The HErrorInfo function provides more information about the error.
Remarks

Error cases

  • Nesting transactions: Transactions cannot be nested (that is, function HTransactionStart or function HTransaction cannot be called within a transaction). In this case, error 70031 occurs.
  • Versions 19 and later
    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 mode is not "Read Uncommitted".
    New in version 19
    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 mode is not "Read Uncommitted".
    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 mode 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 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.
OLE 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: wd270hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment