Re: Locked record
Posted in 1998
ckchan5@my-dejanews.com wrote:
> In article <6s36ah$fbr$1@news.xmission.com>,
> "Marek Miloszewski" <marek.miloszewski@zes.szczecin.pl> wrote:
> > we have a problem with one of our application. Sometimes when somebody is
> > inserting new record into one of the tables, other person has a problem with
> > entering the application. Here is a message displayed:
> > Program stopped at "function.4gl", line number 166.
> > SQL statement error number -244.
> > Could not do a physical-order read to fetch next row.
> > SYSTEM error number -107.
> > ISAM error: record is locked.
> > The problem is that it does not happened continuously. One day yes, another
> > not. Our application producer said this is problem with our Informix
> > configuration. But other programs work properly! I don't know were to look
> > for error...
> >
> Try to alter the table from page locking into a row-locking.
>
> Alter table xxxxx lock mode (row)
This suggestion will reduce the incidence of clashes but not eliminate
them. In your application execute:
SET LOCK MODE TO WAIT 5;
which will permit the process to wait for a locked row to become free
for 5 seconds (you can adjust the timout value) before reporting an
error. Unless the application is poorly written so that it holds locks
while the user is editing a form (it does not look like it since the
error happens seldom currently) 5 seconds is forever for a lock which
usually lives less than a second.
Another possibility is a client program (usually on a PC) that lost
it's connection to the server without committing its transaction. There
are conditions under which the engine cannot detect that the user has
gone away. New 'keep' parameter in the sqlhosts file can help if this
is the problem. Use onstat -g ses to locate remote connections and
track back to their host to see if they are still there if these are
holding any locks (onstat -k).
Art S. kagel