Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Informix > table being locked instead of row

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-02-03, 02:55
markbrown markbrown is offline
Registered User
 
Join Date: Jan 2003
Posts: 2
table being locked instead of row

I am running informix ver 7.

i have two tables one of which is being locked only for that record,

whereas another table is being locked to all records, when updating just one record

can anyone offer some suggestions
Reply With Quote
  #2 (permalink)  
Old 01-02-03, 03:37
thedafna thedafna is offline
Registered User
 
Join Date: Oct 2002
Posts: 52
To change lock mode:
alter table XXX lock mode (page|row);

For row lock mode you need to define more locks in the onconfig - then you have less chances for waitings. The management of the locks costs some. If you have many users to the same table on the same time - think about row.
Reply With Quote
  #3 (permalink)  
Old 01-02-03, 17:58
markbrown markbrown is offline
Registered User
 
Join Date: Jan 2003
Posts: 2
locked table instead of row solved

I have since found the solution since I posted this question.

If you create a unique index on the table
you will overcome the error
eg
create unique index ixtabname on tabname (field)

Regards
Mark
Reply With Quote
  #4 (permalink)  
Old 01-05-03, 05:31
thedafna thedafna is offline
Registered User
 
Join Date: Oct 2002
Posts: 52
Can you explain why it works? doesn't make sence to me.
Reply With Quote
  #5 (permalink)  
Old 01-06-03, 05:27
dananio dananio is offline
Registered User
 
Join Date: Mar 2002
Posts: 112
re

Hahaha ...
Create index always table lock like Alter table
if you want to read you can 'set isolation to diry read ' for the reading session
Reply With Quote
  #6 (permalink)  
Old 04-07-04, 14:57
eduardob eduardob is offline
Registered User
 
Join Date: Apr 2004
Posts: 10
can i do a question

can i do a question in this place of de dbforum? if don't , where can i do it?
Reply With Quote
  #7 (permalink)  
Old 04-07-04, 15:25
eduardob eduardob is offline
Registered User
 
Join Date: Apr 2004
Posts: 10
error 143

can anybody give some solution on the following:

how can i avoid within the application (4gl) the programm abort when it gives the error -244 associated to ISAM error -143.

i have the table locked to row level

i have a unique index on the table

i have made a controll within the sqlca.sqlcode be different of zero

but the programm abort even with these controlls.
Reply With Quote
  #8 (permalink)  
Old 04-07-04, 15:52
WiccaChic WiccaChic is offline
Registered User
 
Join Date: Jan 2004
Posts: 71
how to determine lock level?-

thedafna,
Is there a way to determine how lock level was set at table creation?
Reply With Quote
  #9 (permalink)  
Old 04-08-04, 00:22
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Re: how to determine lock level?-

Quote:
Originally posted by WiccaChic
thedafna,
Is there a way to determine how lock level was set at table creation?


Hi,

To determine the lock level, enter the foll. command at unix prompt

dbschema -d <databasename> -t <tablename> -ss
When you create a table, you can also specify the lock mode


create table test
(
col1 char(1)
)
lock mode row


Regards,

Lloyd
Reply With Quote
  #10 (permalink)  
Old 04-08-04, 06:44
vpshriyan vpshriyan is offline
Registered User
 
Join Date: Nov 2003
Location: Mumbai, India
Posts: 92
Re: how to determine lock level?-

Quote:
Originally posted by WiccaChic
thedafna,
Is there a way to determine how lock level was set at table creation?


Hi,

One of the easiest way to get the infomation is the execute the following SQL via dbaccess or so:

select tabname,locklevel from systables where tabid>99 ;

Regards,
Shriyan
Reply With Quote
  #11 (permalink)  
Old 04-08-04, 14:34
RobP RobP is offline
Registered User
 
Join Date: Mar 2004
Location: Netherlands
Posts: 181
Some extra info, on a lot of realted questions:

- Default lock mode can be changed in the newer engines
(IDS 9.3 and 9.4) with the following parameter:
DEF_TABLE_LOCKMODE
This parameter can be set to page or row (where page is the default)

- You can avoid a 4GL prgram to crash at an error with the statement:
WHENEVER ERROR CONTINUE

- Why it works with an index and not without is also quite logical.
Without an index IDS has to search/investigate all rows for satisfying
conditions. Table is read sequentially, everything is read. By default (in
a logged database) the isolation level is commited read. So every
record that is in an open transaction may not be read. So Informix will
say: Record locked.
With an index you scan the tree (which is not locked) and only some
rows, so lock contention is less likely. So this works.

- When raising such an issue always take a look at:
+ Lock level (page/row)
+ ISOLATION LEVEL
+ LOCK MODE
+ Error capturing in your application
These four things must be set correctly to get the desired goal.

I hope this extra info was meaningfull.

Rob Prop
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

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