Re: Holding Locks?
Posted in 1991
> > I am using Infomix OnLine 4.0 and ESQL/C under DG/UX 4.31 > and have a unique problem. I have a group of 4 tables that I > want to lock and keep locked until I am done with all the processing > I need to perform. The first part (i.e Locking the tables) is quite > simple, but my question is how do I keep them locked when I am accessing > a database that uses logging? In (I believe) all SQL databases when > you "commit work" all row-level and table-level locks are released and > cursors defined without the "WITH HOLD" clause are closed! I could attempt > to go re-aquire the locks again but there is no guarantee that I will get > them! I can't change the transaction logging params from within ESQL/C > code nor would I want to. I would like to somehow use the informix > locks because it seems more elegant and easier to do. > > If anyone has run into this problem or one similar, PLEASE let me know > asap before I go off writing some unnessary locking functions on top > of the standard UNIX file system .... > We are running OnLine 4.10.UC1 and ESQL/C-ALL (a superset of ESQL/C, which provide support for the pre-SQL Informix Product function calls). Our approach to this problem was to exec another process that would also open the database and have its own sqlturbo process. This effectively provides two separate transactions that the parent process can control. The parent process directs the child which rows that it wants to keep locked. The child is in control of these "special" records so any updating has to be done by the child, but most likely at the direction of the parent. When the parent is done doing it's multiple transactions, it than directs the child to either commit or abort it's transaction. You still have to write some code for the two processes to communicate, but that was a cleaner/easier solution for us. > Thanks in advance! > Chris Hopen > > Email: n8420101@henson.cc.wwu.edu > USmail: Geographic Technology > 301 Telegraph Rd. > Bellingham WA 98226 > What approaches have others taken? Ken Evilsizor Email: {uceng,sdrc}!cinnet!carsinfo!ken CARS Information Systems Corp. 4000 Executive Park Dr. Cincinnati, OH 45241