[Fwd: Re: Locking problem in INFORMIX ONLINE 7.20. UC2]
Posted in 1997
This is a multi-part message in MIME format.
--------------1E7310831924
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
--
\\\\|//
Vijay R. Anisetti |6 6|
-------------------oooO--U--Oooo----------------------------
oooO Oooo
( ) ( ) Just hangin on to this profession
---------------\\( -- )/-------------------------------------
\\) (/
--------------1E7310831924
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-ID: <33C29615.FAB@sprynet.com>
Date: Tue, 08 Jul 1997 15:33:41 -0400
From: "Vijay R. Anisetti" <rambabu@sprynet.com>
Organization: personal
X-Mailer: Mozilla 3.0 (Win95; I)
MIME-Version: 1.0
To: "Infodata Ltd. (Sharjah) U.A.E." <infodsh@emirates.net.ae>
Subject: Re: Locking problem in INFORMIX ONLINE 7.20. UC2
References: <199707081321.RAA26141@ns2.emirates.net.ae>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Yes, if it encounters an error while reading rows, it stops the
execution.
You check the following SQL to exclude the locked row:
select * from tab1
where a = '1' or ( a > '2' and a < '9') ;
hope this is not one of the 'different ways' you tried.
--
\\\\|//
Vijay R. Anisetti |6 6|
-------------------oooO--U--Oooo----------------------------
oooO Oooo
( ) ( ) Just hangin on to this profession
---------------\\( -- )/-------------------------------------
\\) (/
Infodata Ltd. (Sharjah) U.A.E. wrote:
>
> Dear friends,
>
> My problem is as follows :
> Example -->
>
> I have a table tab1 with one field a (char(2)).
> There are 10 records in it.
> The value in the field is '1' ,'2','3' .... to '10' for each of the
> 10 records.
>
> Now I am opening one session and locking a particular record as follows :
>
> alter table tab1 lock mode (row);> begin work;
> update tab1
> set a = 20
> where a = 2 ;
>
> Now I am opening another session and selecting rows from that table as follows :
>
> set isolation to committed read;
> select * from tab1
> where a > = '1' and a <= '9' ;>
> This reads only first record and the second record and will give an SQL
> error for record lock.
> This is quiet understandable since there will be an exclusive lock for that row.
>
> But does the row level lock prevent all the rows after it also to be locked.
> I have tried this in different ways
> but everytime it comes to a locked row it will stop & give error and will
> not show the remaining rows.
>
> What I want to say is that IT LOCKS MORE THAN ONE ROW ( all rows after the
> locked row). Is this O.K. or an bug or am I doing some mistake in
> understanding it.
>
> Please throw some light if U can.
>
> I know about 'set lock mode to wait' but what I am confused is why is it
> locking more than one row & how to prevent it.
>
> Thanks
>
> Bharat Shah
> INFODATA Ltd.
> P.O.Box 24114, Sharjah, U.A.E.
> Email: infodsh@emirates.net.ae
> Tel.: 971 6 599848, Fax: 971 6 592618
--------------1E7310831924--