Skip to Content
0
Sep 09, 2019 at 06:00 AM

Sybase 15.7 “select for update” + “readpast” race condition

695 Views

I have a simple SQL,

begin tran xxx;
select top 50 * from aTable readpast for update;
commit tran xxx;

And I ran from three threads (each thread starts own transaction). What I have observed is that sometimes two threads are returning the same set of records.

According to Sybase manual, "for update" should have locked the records that I have selected and readpast should have prevented me from reading locked records.

isolation level is 1.

select for update has been enabled sp_configure.

aTable is datarows locking

Any pointer is appreciated.