PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV, WEBDEV, WINDEV Mobile 25 feature!
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Validates the current transaction:
AndroidAndroid Widget iPhone/iPadWindows Mobile The management of transactions is available for the HFSQL Client/Server databases.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
Android This function is now available for Android applications.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
Android This function is now available for Android applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Java This function is now available for the Java applications.
Android This function is now available for Android applications.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
MyConnection1 is Connection
 
// Start transaction on data files associated with MyConnection1
MyConnection1.TransactionStart()
 
// Code used to prepare the order to added
// ...
 
WHEN EXCEPTION IN
// Add the order
Order.Add()
// Validate the addition
MyConnection1.TransactionEnd()
DO
// Delete the order lines
MyConnection1.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 occurred. HErrorInfo returns more details about the error.
Caution: The function has no effect if a global transaction is started. 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 occurred. HErrorInfo returns more details about the error.
Remarks

Error cases

  • Nesting transactions: Transactions cannot be nested (i.e. call <Connection variable>.TransactionStart or <Connection variable>.Transaction in 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. See Transactions: Handling records during a transaction for more details.

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.
WINDEVWEBDEV - Server codeOLE 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 : wd250hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment