Update cursor showing error 244 (row locked) even when row is not returned by query
Posted in 2003
Topics: Transactions, Locking & Isolation
Hi everyone, We have a requirement here that we should be able to run two instances of the same program to fetch rows from a table and get the data. Once done they are to be deleted. Now we are using cursors to get the row. The reason why they want to go for two instances is to speed up things. Now the problem here is that when one instance picks up row 1, we don't want the second instance to pick up row 1. Hence we used an updatable cursor. The first instance update cursor would say (select from table where id = 1) and the second instance would say (select from table where id = 2). These rows being returned are totally different subsets. Catch here is that when the first instance runs..it returns all rows with id 1. The lock mode is set to not wait. Now when the second instance runs, it tries to get rows with id 2 but the error 244 (row is locked physically). I could understand this problem if the second instance was trying to get rows with id 1. but this has left me puzzled. I am using Informix for C++ classes to do this. The ITCursor class namely. Any pointers? Thanks in advance. I know that this is one of the lists where we have some really cool folks who know the stuff.. Kind Regards Philip