Re: Do SELECT statemetns create any locks on a 5.X OnLine Engine
Posted in 1996
Todd Gill wrote: > > I've read the FAQ and documentation, but can't seem to find an answer to my > (naive?) question. > > I am writing an application that I don't want to interfere with other > applications accessing (doing update/inserts) the same database. Will > declaring a cursor with hold for a query select * from some_table create > any locks that the other processes might contend with? The database is > using logging if that matters. I am using ESQL/C against a 5.X OnLine > engine. > > Thanks for any help, > Todd Gill > tgill@lynx.dac.neu.edu Todd, you must use Dirty Read or Committed Read Isolation Mode. If you use Cursor Stability rows will be locked as they are fetched and the lock will be released on the previous row as the next row will be fetched.If you however fetch each row inside a transaction the rows will remain locked until the transaction is ended. If you use Repeatable Read all rows will be locked and will remain locked until the transaction is ended or the cursor is closed. Repeatable Read is the default isolation level in case of a ANSI database and Committed Read in a not ANSI Database with logging. Yours, Tolis +---------------------------------------------------------------------+ | Tolis Varnas email: tvarnas@compulink.gr | | Deligiorgi 26 tvarnas@orbit.de | | 546 42 Thessaloniki Voice: (30) 31 820270 | | Greece Fax: (30) 31 865463 | +---------------------------------------------------------------------+