Re: Share Mode Locking Problem...
Posted in 1997
Chad Chervitz wrote:
>
> I'm new to the Informix world, so pardon any mistaken assumptions I may
> have (that's my disclaimer)...
>
> I wish to run a process which updates a bunch of rows in a table, makes a
> calculation, and then rollback all the changes in the end (think what-if
> scenarios). At the same time as playing out the scenario, I need for
> other users to be able to have read access to the old (already
> committed) data.
>
> So, I issue the following:
>
> begin work;
> lock table table in share mode;
> update table
> set colb = ####
> where cola = "this";
>
> Then, without comitting/rolling back the above, in another session, I
> issue:
>
> select * from table
> order by cola;>
> Instead of getting the old values for each row, I get:
>
> 243: Could not position within a table (informix.test_update).
> 107: ISAM error: record is locked.>
> My isolation and transaction modes are set to their defaults (non-ansi
> databases).
To get the old values from a locked table SET ISOLATION DIRTY READ.
Art S. Kagel