> > It allows me to read uncommited records without blocking.
>
> Yes, but that does not solve his problem. He wants a single lock, and
> wants to test the lock, and immediately return if the lock fails.
>
If you know the read was dirty, you know there was somebody else
locking/writing the table or record, it's locked, you failed to lock.
Of course you should be able to aquire the lock in the same atomic
operation...
...Pablo