TTSEndTransaction

Ends an explicit transaction and returns a transaction reference number (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call call NWTTSEndTransaction.)

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.x, 4.x, 5.x, 6.x
Platform:NLM
Service:Server-Based TTS

Syntax

  #include <\nlm\nit\nwtts.h>  
   
  int TTSEndTransaction (  
     long   *transactionNumber); 
  

Parameters

transactionNumber
(OUT) Receives the transaction reference number of the ended transaction.

Return Values

Decimal

Hex

Constant

0

(0x00)

ESUCCESS

253

(0xFD)

ERR_TTS_DISABLED

Transaction could not be ended because TTS is disabled.

254

(0xFE)

ERR_TRANSACTION_ENDS_RECORDS_LOCKED

Transaction was ended abnormally, but records were left locked. This error is only for implicit transactions.

255

(0xFF)

ERR_EXPLICIT_TRANSACTION_ACTIVE

Remarks

A transaction is not necessarily completed to disk when this function returns. If the server fails before all transaction updates are written to disk, the transaction is backed out when the server is rebooted.

TTSTransactionStatus verifies a successful transaction completion to disk; or, if transaction tracking is disabled, the reference number can used to determine when the transaction is completely written to disk.

This function releases the following physical record locks:

  • Physical record locks generated by TTS when a write operation is performed on a nonlocked record
  • Physical or logical locks that have not yet been released because of a transaction

For explicit transactions, the transaction is completed and any locks being held are released.

If implicit transactions are enabled and the number of logical or physical records still locked by the application exceeds the threshold, this function returns a value of 0xFE. In this case, the server automatically starts a new implicit transaction. However, the explicit transaction is still completed and any locks being held are released.

See Also

TTSAbortTransaction, TTSBeginTransaction, TTSIsAvailable, TTSTransactionStatus