TTSBeginTransaction

Begins an explicit transaction (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWTTSBeginTransaction.)

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 TTSBeginTransaction (void); 
  

Return Values

Decimal

Hex

Constant

0

(0x00)

ESUCCESS

150

(0x96)

ERR_SERVER_OUT_OF_MEMORY

254

(0xFE)

ERR_IMPLICIT_TRANSACTION_ACTIVE

Converted to an explicit transaction.

255

(0xFF)

ERR_EXPLICIT_TRANSACTION_ACTIVE

Remarks

After TTSBeginTransaction is called, TTS tracks all files that are marked transactional and are currently open as well as transactional files that are opened during the transaction. When an application writes to a transaction file, the server automatically generates a physical record lock for that file. If the record is already locked, the server does not generate an additional lock.

Transaction files are not closed and unlocked until a TTSEndTransaction or TTSAbortTransaction is executed.

If transaction files are updated, logical and physical record locks are held until the end of the transaction. If a transaction file is not updated, any logical or physical lock on that file can be released at any time.

NOTE:Transactions are tracked and evaluated by connection number and task number. Therefore, in order for transactions on a file to be monitored, the thread must have its connection and task numbers set to the same connection and task numbers that were used to open the file. (Remember, setting the connection and task number for one thread changes the connection and task numbers for all of the threads that belong to the same thread group.)

See Also

TTSAbortTransaction, TTSEndTransaction, TTSIsAvailable, TTSTransactionStatus