home *** CD-ROM | disk | FTP | other *** search
- {#Z+}
- {(10U&l12D(s4099T&k2S}
- {***************************************************************************}
- {** Program : NWTTS **}
- {***************************************************************************}
- {** Version : 1.53 ** Started : 11/11/91 ** Ended : / / **}
- {***************************************************************************}
- {******************************** Description ******************************}
- {***************************************************************************}
- {** OOP library for Netware API **}
- {** **}
- {** This unit forms the second level object : TTS **}
- {** This object is a descandent of : NETWARE **}
- {** **}
- {** **}
- {** **}
- {** **}
- {***************************************************************************}
- {******************************** Information ******************************}
- {***************************************************************************}
- {** Provides Netware Transaction Tracking Services **}
- {** **}
- {** **}
- {** **}
- {** This code is (c) 1991 - 1994 Antonio Covelli. ALL RIGHTS RESERVED. **}
- {** Portions (c) Novell Inc, **}
- {** **}
- {** **}
- {***************************************************************************}
-
- {$I NETWARE.INC}
- {#Z-}
-
- UNIT NWTTS;
-
- INTERFACE
-
- USES
-
- nwvar,
- netware;
-
- TYPE
-
- pTTSOBJ = ^TTSOBJ;
- TTSOBJ = OBJECT (NetwareOBJ)
-
- FUNCTION TTSAbortTransaction : WORD;
- { Aborts explicit and implicit transactions. If a transaction is aborted,
- all writes made since the beginning of the transaction are discarded. The
- following record locks are released:}
- {#F}
- {}
- { Physical record locks generated by the file server when an application }
- { tried to write to am unlocked record. }
- {}
- { Physical or logical locks that have not been released because of a }
- { file write. }
- {#F}
- {}
- { For explicit transactions, the transaction is backed out and any locks
- being held are released. }
- {}
- { For implicit transactions, if the number of logical or physical records
- still locked exceeds the threshold, this function returns a completion
- code of TRANSACTION_RESTART. In other words, the transaction is backed out
- and the file server automatically starts a new implicit transaction. }
-
- FUNCTION TTSBeginTransaction : WORD;
- { Begins an explicit transaction. After this function TTS traks all files
- that are currently open and any files that are opened during the
- transaction. Transaction files are not closed and unlocked until either
- #TTSEndTransaction# or #TTSAbortTransaction# is executed. }
-
- FUNCTION TTSEndTransaction (VAR TransactionNumber : longint) : WORD;
- { This function ends an explicit transaction and returns a Transaction
- Number. A transaction is not necessarily completed to disk when this
- function returns. The returned transaction number can be used by
- #TTSTransactionStatus# to verify whether a transaction was successfully
- committed to disk.
-
- If the file server fails before all transaction updates are written to
- disk, the transaction will be backed out when the file server is rebooted,
- unless transaction tracking is disabled. }
- {#F}
- {}
- { TransactionNumber: contains the transaction number of the transaction
- just ended. This can be used by #TTSTransactionStatus# to
- verify whether the transaction was successfully written
- to disk. }
- {#F}
- {#X TTSAbortTransaction }
-
- FUNCTION TTSGetApplicationThresholds (VAR LogicalRecordLockThreshold,
- PhysicalRecordLockThreshold : byte) : WORD;
- { Allows an application to determine the number of logical and physical
- record locks allowed before an implicit transaction is started. For
- example, if a threshold value is 0 then when the first lock is made for
- that particular lock an implicit transaction is started. Thus, if the
- threshold is 50 then on the 51st lock an implicit transaction is started.
- The default values for boths types of locks is 0. An application can set
- the threshold to 0xFF which disables implicit transactions for that lock
- until the application terminates or resets the values. }
- {#F}
- {}
- { LogicalRecordLockThreshold : contains the current setting for logical
- record locks. }
- { PhysicalRecordLockThreshold: contains the current setting for physical
- record locks. }
- {#F}
- {#X TTSSetApplicationThresholds}
-
- function TTSGetTransactionBits (var TransactionBits : byte) : word;
- { Returns the transaction bits (control flags) for a task. Only bit 0 is
- used. If bit 0 is set then forced record locking is on. The default state
- of forced record locking is on. All other bits are reserved. }
- {#F}
- {}
- { TransactionBits: contains the current transaction bit setting. }
- {#F}
- {#X TTSSetTransactionBits }
-
- FUNCTION TTSGetWorkStationThresholds (VAR LogicalRecordLockThreshold,
- PhysicalRecordLockThreshold : byte) : WORD;
- { This function allows a station to determine the number of logical and
- physical record locks allowed before an implicit transaction is started. }
- {#F}
- {}
- { LogicalRecordLockThreshold : contains the current setting for logical
- record locks. }
- { PhysicalRecordLockThreshold: contains the current setting for physical
- record locks. }
- {#F}
- {#X TTSSetWorkStationThresholds }
-
- FUNCTION TTSIsAvailable : WORD;
- { Verifies whether the default file server supports transaction tracking. }
-
- FUNCTION TTSSetApplicationThresholds (LogicalRecordLockThreshold,
- PhysicalRecordLockThreshold : BYTE) : WORD;
- { Allows an application to set the number of logical and physical record
- locks allowed before an implicit transaction is started. For example, if a
- threshold value is 0 then when the first lock is made for that particular
- lock an implicit transaction is started. Thus, if the threshold is 50 then
- on the 51st lock an implicit transaction is started. The default values
- for boths types of locks is 0. An application can set the threshold to
- 0xFF which disables implicit transactions for that lock until the
- application terminates or resets the values. }
- {#F}
- {}
- { LogicalRecordLockThreshold : contains the new setting for logical record
- locks. }
- { PhysicalRecordLockThreshold: contains the new setting for physical record
- locks. }
- {#F}
- {#X TTSGetApplicationThresholds }
-
- function TTSSetTransactionBits (TransactionBits : byte) : word;
- { Allows an application to set the transaction bits (control flags). If bit
- 0 of the transaction bits is set then forced record locking is ON. If
- clear forced record locking is OFF. The default is bit 0 set. }
- {#F}
- {}
- { TransactionBits: contains the new transaction bit settings. }
- {#F}
- {#X TTSGetTransactionBits }
-
- FUNCTION TTSSetWorkStationThresholds (LogicalRecordLockThreshold,
- PhysicalRecordLockThreshold : BYTE) : WORD;
- { This function allows a station to set the number of logical and physical
- record locks allowed before an implicit transaction is started. The values
- set by this function call continue to be valid for all applications run
- on the particular workstation until another call is made to this function,
- SETTTS is run or an EndOfJob call is made (threshold levels are reset
- to 0). }
- {#F}
- {}
- { LogicalRecordLockThreshold : contains the new setting for logical record
- locks. }
- { PhysicalRecordLockThreshold: contains the new setting for physical record
- locks. }
- {#F}
- {#X TTSGetWorkStationThresholds }
-
- FUNCTION TTSTransactionStatus (TransactionNumber : longint) : WORD;
- { Verifies whether a transaction has been written to disk. Transactions
- are written to the disk in the order in which they ended. }
- {#F}
- {}
- { TransactionNumber: contains the transaction number to verify if it has
- been written to disk. }
- {#F}
- {#X TTSEndTransaction }
-
- DESTRUCTOR Done; VIRTUAL;
-
- END;
-
-