RecVersion property |
Applies to
TIB_Transaction
Declaration
Property RecVersion : boolean;
Description
This property only takes affect when Isolation is set to tiCommitted.
It determines if the most recent record version must be seen or if an earlier
record version can be seen in order to avoid a deadlock when reading records.
Setting this property to true will avoid deadlocks by allowing uncommitted
changes in the database to be ignored. Only the most recent committed changes
will be visible. I consider this the "friendly" mode of committed isolation.
If the most recent record must be seen and another user or transaction has an
update or delete pending then a deadlock condition is generated when the
record that has been updated or deleted is encountered. Deadlock will occur
even when selecting the data using this mode of tiCommitted isolation. Unless
LockWait is true an immediate Deadlock cannot be avoided. Which, in this case,
would prevent a user from finishing the processing of the query.
When RecVersion is set to false LockWait is generally set to true so that
queries or multi-record updates, deletes, etc. will be able to process to
completion without a deadlock exception. It is VERY important that all
transactions performing updates, deletes, etc. have a very short duration in
this type of configuration so that a client application will not appear to be
locked up indefinitly.
This is the only case where a deadlock can be hit when selecting data other
than if there is a conflict with another transaction that was started using
tiConsistency against the same table. tiConsistency is effectively a way to
force exclusive access to specified tables during a transaction.