Re: INFORMIX is totally wrong or ...
Posted in 1993
>From: uunet!kowari.cpsg.com.au!jan (Jian Cai) >Subject: INFORMIX is totally wrong or ... >Date: Tue, 13 Apr 1993 03:13:44 GMT >X-Informix-List-Id: <news.3026> > >1) INFORMIX is based on CISAM (i.e. CISAM is the lower level stuff); >2) CISAM call isclose() releases all locks (according to the doc); >3) before rollback or commit, call isclose() (according to doc/examples), i.e.: > ... within a transaction ... > isclose(); /* to close tables */ > ... > isclose(); > ... > Call iscommit() or isrollback() >Between isclose() and isrollback()/iscommit(), other transactions can have >access to tables/records. This means isclose() exposes uncommitted >transactions to the outside world - a wrong "transaction" by definition. > >Your choice: either INFORMIX is totally wrong, or one of the three >statements above is incorrect. Statement 1 is correct. Statement 3 is correct, but needs some extra comments. Statement 2 is not totally correct. Referring to Chapter 5 of the C-ISAM Programmer's Manual (Version 5.00) includes the following comments: p5-5: You start a transaction by calling isbegin() before any other C-ISAM call. You end the transaction by calling iscommit() after adding both records [which translates to "make any changes to the data files"]. If a call to iswrite() fails, isrollback() cancels the transaction. You must include the ISTRANS parameter in the isopen() call if you want isrollback to reset any changed records to their original state. If you update a file, it is very important that you open and close the file within the transaction. p5-9: When a transaction begins, all C-ISAM function calls that modify a record lock the record. These records remain locked until you execute iscommit() or isrollback(). A call to isrelease() during a transaction only releases unmodified records. Locks on modified records are not released. Likewise, a call to isunlock() only only works if the records in the file are not modified by the transaction. From this it is clear that the documentation on p8-19 (where it says unambiguously "Note: the program releases any locks it holds"), needs to be amended to say something like "Note: outside the scope of a transaction, the isclose releases any locks held on the table by the program. Within a transaction, the locks are held until the transaction is commited by iscommit() or rolled back by isrollback()". There should be some comment about what happens if a C-ISAM program is in a transaction and fails before either iscommit() or isrollback() is executed, but it is better if it doesn't happen. I've sent a copy of this mail to the Informix documentation team. Yours, Jonathan Leffler (johnl@obelix.informix.com) #include <disclaimer.h>