我想锁定一条记录以防止在我使用时没有人可以更新。
但是锁定记录后,即使我自己也无法更新锁定记录:(
在更新记录之前我必须解锁吗?
或者有没有办法更新我锁定自己的记录?
string query = "SELECT * FROM table1";
AdsCommand cmd = conn.CreateCommand();
cmd.CommandText = query;
AdsExtendedReader reader = cmd.ExecuteExtendedReader();
reader.Read();
int recordNo = reader.RecordNumber;
reader.LockRecord(recordNo);
// do something with table1 record
// while doing something, I need to lock the record before I update record
AdsCommand cm = new AdsCommand("UPDATE table1 SET field1 = 'UPDATED'", conn);
cm.ExecuteNonQuery();