TomBascom
Curmudgeon
You can FIND a changed (or newly created) record with a NO-LOCK read even while the transaction is uncommitted. This is called a “dirty read”.
So you can successfully read a record and have uncommitted content available to your program even if the record is eventually rolled back.
You can easily demonstrate this with two sessions open in two different windows by sprinkling PAUSE and MESSAGE statements around and stepping through some sample code.
Most of the time the chances of a problem arising from this are small and the potential impact is ignored. It is very common for application code to simply ignore this possibility.
But when you are doing something like tracking changes for replication purposes (or handling money) you tend to want a more careful approach.
So you can successfully read a record and have uncommitted content available to your program even if the record is eventually rolled back.
You can easily demonstrate this with two sessions open in two different windows by sprinkling PAUSE and MESSAGE statements around and stepping through some sample code.
Most of the time the chances of a problem arising from this are small and the potential impact is ignored. It is very common for application code to simply ignore this possibility.
But when you are doing something like tracking changes for replication purposes (or handling money) you tend to want a more careful approach.