RE: Locking, please help.
Posted in 1999
See below
-----Original Message-----
From: Rico [SMTP:rico@wsx.wsex.com]
Sent: Thursday, September 09, 1999 2:22 PM
To: informix-list@iiug.org
Subject: Locking, please help.
Hello all,
I am currently having some problems with locking.
My problem simplified seems to be this, as far as I can tell:
Application 'A' does large update of a high use table 'x' like this -
begin work
foreach
insert or update on table x
end foreach
commit work
Application 'B' does simple insert into high use table like this -
begin work
insert on table x
commit work
So, while App A does inserts/updates, App B error's out like this -
SQL statement error number -271.
Could not insert new row into the table.
SYSTEM error number -154.
ISAM error: Lock Timeout Expired.
Is it a general rule that if you use a transaction to do a update/insert on
a table, no other process can insert into the table until the transaction
is completed?
[Murray Wood] You lock the page(s) or row(s) until the transaction is
complete. Most people (I think) use row locking, or otherwise a
transaction may block too many other users.
Or, is it because I am using page level locking and some rows are getting
locked that shouldn't be?
[Murray Wood] THe page is getting locked - data AND index pages. Far more
than I would want.
If it is page level locking, what type of perfomrance degradation might be
associated with altering a table to row level locking?
[Murray Wood] With row locking, you consume more locks so need to
configure your instance accordingly. A lock is an almost trivial set of
Informix code. Performance would unlikely to be noticed.
I have the applications in question 'set lock mode to wait 20'.
My apologies if this is a stupid question.
Oh, IDS 7.30.UC6 on sun os 5.6.
Thanks in advance.
Olaf