Re: Holding Locks?
Posted in 1991
Chris writes:- > 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. > Have you thought of DATABASE EXCLUSIVE. If you want to lock four tables then I am guessing that not much else is going on at the same time anyway. Assuming that the above is not possible and that you cant afford to have enough locks and log space to allow the entire processing to be treated as a single transaction. Then, I'm afraid that you are stuck with coding your own application locks. I put a suggestion on the net a month or two ago for an SQL extension FETCH WITH HOLD to allow locks to be held beyond the commit this could be extended to LOCK TABLE WITH HOLD. I didn't have any negative or positive responses from anybody (including informix) on this, but I have raised the issue with our own support people to raise as a feature request. On the subject of feature requests does anyone else need to be able to specify the number of decimal places for a numeric field at run time rather than compile time. This would be useful for us in multi-currency applications. Currently we have to use a char field and validation functions and it still leaves the problem of having to enter a trailing space or CTRL-D to clear the old contents of the field. Cheers, Jim -------------------------------------------------------------------- Name: Jim Gordon Internet: jgordon@ssf-sys.DHL.COM Company: DHL Systems Inc Phone: (415) 358-5911 Address: 1700 S. Amphlett Blvd. Fax: (415) 571-6429 San Mateo, CA 94402 --------------------------------------------------------------------