If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Locks question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-02-08, 12:59
yevgeni yevgeni is offline
Registered User
 
Join Date: May 2008
Posts: 2
Locks question

Hello to everyone

I'm completely new in Informix but had a lot of experience with DB2

Here is my problem:

Assume that my TABLE has an integer ZZZ column. Further assume that I explicitly create an index on ZZZ.

Table was created lock mode ROW and ZZZ as primary key

Now consider this "start of transaction":

set isolation to repeatable read;
begin;
select * from TABLE where ZZZ=5;

I expected that it should place a lock ONLY ON those records for which the value of ZZZ=5.

In my case ZZZ is a primary key , so there is only one record where ZZZ=5

Now ...
running onstat -k, I see that the WHOLE TABLE IS LOCKED (rowid=0).

Since part of my design relies on the expected behavior of repeatable read, what am I missing?


Thanks in advance for any help !
Reply With Quote
  #2 (permalink)  
Old 05-03-08, 00:02
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Not an Informix guy, but a search for informix and "row-level locking" suggests that you need to turn it on for each table that needs it. Source. Apparently you can do it at CREATE time or via ALTER TABLE.

Caveat lector: that source isn't the Informix docs. I'd suggest you look there, maybe for the phrase "LOCK MODE".
Reply With Quote
  #3 (permalink)  
Old 05-03-08, 00:31
yevgeni yevgeni is offline
Registered User
 
Join Date: May 2008
Posts: 2
Quote:
Originally Posted by sco08y
Not an Informix guy, but a search for informix and "row-level locking" suggests that you need to turn it on for each table that needs it. Source. Apparently you can do it at CREATE time or via ALTER TABLE.

Caveat lector: that source isn't the Informix docs. I'd suggest you look there, maybe for the phrase "LOCK MODE".

My table was created with row-level locking as I wrote in my first post
Thanks !
Reply With Quote
  #4 (permalink)  
Old 05-03-08, 19:24
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Baghdad, Iraq
Posts: 697
Quote:
Originally Posted by yevgeni
My table was created with row-level locking as I wrote in my first post
Thanks !
My bad, I completely missed that. Well, I'm stumped.
Reply With Quote
  #5 (permalink)  
Old 05-05-08, 12:02
mjldba mjldba is offline
Registered User
 
Join Date: Dec 2003
Location: North America
Posts: 139
If the database was created as logging-type ANSI, every row processed will have a shared lock placed on it.

I found that info at http://www.ibm.com/developerworks/db...ber/index.html
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On