row-level locking bug?
Posted in 2004
Topics: Error Codes & Troubleshooting
Has anybody any idea what to do with the bug below?
I think it is very serious and I am looking for a solution or an Informix
version in which the bug is solved.
Or am i missing something?
Informix Dynamic Server Version 9.30.FC3
HPUX 11 (64 bits kernel)
create table t1 (f1 int, f2 int) lock mode row;begin work;
insert into t1 values (1,1);
insert into t1 values (2,2);
insert into t1 values (3,3);commit work;
Situation1:
Session1:
begin work;
update t1
set f1=2
where f2=1
Session2:
begin work;
update t1
set f1=2
where f2=2
244: Could not do a physical-order read to fetch next row.
107: ISAM error: record is locked.
Situation2:
Session1:
begin work;
insert into t1 values (4,4)
Session2:
begin work;
delete from t1 where f1=5
244: Could not do a physical-order read to fetch next row.
107: ISAM error: record is locked.
Situation3:
create index i_t1_1 on t1(f2)
Session1:
begin work;
insert into t1 values (4,4)
Session2:
begin work;
delete from t1 where f1=51 row deleted
Situation4:
create table t2 (f1 int, f2 char(10)) lock mode row;begin work;
insert into t2 values (1,1);
insert into t2 values (2,2);
insert into t2 values (3,3);
create index i_t2_1 on t2(f2);commit work;
Session1:
begin work;
insert into t2 values (5,5)
Session2:
begin work;
delete from t2 where f2=1
244: Could not do a physical-order read to fetch next row.
107: ISAM error: record is locked.
Reason: index can not be used (f2=1)
To confirm this:
Situation6:
Session1:
begin work;
insert into t2 values (5,5)
Session2:
begin work;
delete from t2 where f2="1"
1 row deleted
Met vriendelijke groet,
Peter Schouten
Procesmanager Woningcorporaties
Centric IT Solutions
Postbus 29080
3001 GB Rotterdam
Tel. 010 2170400
Fax. 010 2170338
-------------------------------------
The information included in this message is personal and/or confidential and
intended exclusively for the addressees as stated. This message and/or the
accompanying documents may contain confidential information and should be
handled accordingly. If you are not the intended reader of this message, we
urgently request that you notify Centric immediately and that you delete
this e-mail and any copies of it from your system and destroy any printouts
immediately.
It is forbidden to distribute, reproduce, use or disclose the information in
this e-mail to third parties without obtaining prior permission from
Centric. We expressly point out that there are risks associated with the use
of e-mail. Centric and the companies within the group shall not accept any
liability whatsoever for damage resulting from the use of e-mail. Legally
binding obligations can only arise for Centric by means of a written
instrument, signed by an authorized representative of Centric.
-------------------------------------
sending to informix-list
Schouten, Peter wrote:
> Has anybody any idea what to do with the bug below?
> I think it is very serious and I am looking for a solution or an Informix
> version in which the bug is solved.
> Or am i missing something?
>
> Informix Dynamic Server Version 9.30.FC3
> HPUX 11 (64 bits kernel)
>
>
> create table t1 (f1 int, f2 int) lock mode row;> begin work;
> insert into t1 values (1,1);
> insert into t1 values (2,2);
> insert into t1 values (3,3);> commit work;
>
>
> Situation1:
>
> Session1:
> begin work;
> update t1
> set f1=2
> where f2=1
>
> Session2:
> begin work;
> update t1
> set f1=2
> where f2=2
>
> 244: Could not do a physical-order read to fetch next row.
> 107: ISAM error: record is locked.>
>
> Situation2:
>
> Session1:
> begin work;
> insert into t1 values (4,4)>
> Session2:
> begin work;
> delete from t1 where f1=5>
> 244: Could not do a physical-order read to fetch next row.
> 107: ISAM error: record is locked.>
>
> Situation3:
> create index i_t1_1 on t1(f2)>
> Session1:
> begin work;
> insert into t1 values (4,4)>
> Session2:
> begin work;
> delete from t1 where f1=5> 1 row deleted
>
>
> Situation4:
> create table t2 (f1 int, f2 char(10)) lock mode row;> begin work;
> insert into t2 values (1,1);
> insert into t2 values (2,2);
> insert into t2 values (3,3);
> create index i_t2_1 on t2(f2);> commit work;
>
> Session1:
> begin work;
> insert into t2 values (5,5)>
> Session2:
> begin work;
> delete from t2 where f2=1>
> 244: Could not do a physical-order read to fetch next row.
> 107: ISAM error: record is locked.>
> Reason: index can not be used (f2=1)
>
> To confirm this:
> Situation6:
>
> Session1:
> begin work;
> insert into t2 values (5,5)>
> Session2:
> begin work;
> delete from t2 where f2="1">
> 1 row deleted
>
> Met vriendelijke groet,
>
> Peter Schouten
> Procesmanager Woningcorporaties
> Centric IT Solutions
> Postbus 29080
> 3001 GB Rotterdam
> Tel. 010 2170400
> Fax. 010 2170338
>
>
>
>
>
> -------------------------------------
> The information included in this message is personal and/or confidential and
> intended exclusively for the addressees as stated. This message and/or the
> accompanying documents may contain confidential information and should be
> handled accordingly. If you are not the intended reader of this message, we
> urgently request that you notify Centric immediately and that you delete
> this e-mail and any copies of it from your system and destroy any printouts
> immediately.
> It is forbidden to distribute, reproduce, use or disclose the information in
> this e-mail to third parties without obtaining prior permission from
> Centric. We expressly point out that there are risks associated with the use
> of e-mail. Centric and the companies within the group shall not accept any
> liability whatsoever for damage resulting from the use of e-mail. Legally
> binding obligations can only arise for Centric by means of a written
> instrument, signed by an authorized representative of Centric.
> -------------------------------------
>
>
> sending to informix-list
Your post is too big for my currently available time.
But if you don't have an index the querys must do a sequential scan and
this will hit the lock from other session... It's not a bug.
Regards.
"Schouten, Peter" <Peter.Schouten@centric.nl> wrote in message news:c7ag92$9g4$1@terabinaries.xmission.com... > > Has anybody any idea what to do with the bug below? > I think it is very serious and I am looking for a solution or an Informix > version in which the bug is solved. > Or am i missing something? have you created necessary indices in the table. Without them, the engine will be forced to do a sequential scan. if isolation level requries locking all rows during inspection, you will get the error you are seeing.