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 > lock rows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-01-04, 10:39
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 283
Thumbs down lock rows

Hi,

I have a select where this statement return more one rows and i nedd lock this row, but i want not use for update, how can to do this activity.

Thank you.
Reply With Quote
  #2 (permalink)  
Old 06-01-04, 12:05
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Hi Georgipa,

Please test running SET ISOLATION TO REPEATABLE READ;
SELECT .......

Gustavo.
Reply With Quote
  #3 (permalink)  
Old 06-02-04, 08:37
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 283
Hi,
You can give me an example for this activity, for example seudo code.

Than you for your help.
Reply With Quote
  #4 (permalink)  
Old 06-02-04, 09:45
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Hi,

Please test:

Begin work;
set isolation to repeatable read;
select * from anytable
where .....

This lock all read rows.

Gustavo.
Reply With Quote
  #5 (permalink)  
Old 06-03-04, 09:08
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 283
Hi,

I test this statements in a session and other user login in other session and execute this same statements and no lock row.

thank you for you help.
Reply With Quote
  #6 (permalink)  
Old 06-03-04, 11:18
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Hi Georgipa,

The lock is put. Tried you to rewrite the row ??

Gustavo.
Reply With Quote
  #7 (permalink)  
Old 06-04-04, 09:42
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 283
Hi,
In this case is fine, but I need execute
begin work;
set isilation to repeatable read;
select * from table1
where codigo_tabla = "XX";


and lock this rows thar return this select, whether other user execute

begin work;
set isilation to repeatable read;
select * from table1
where codigo_tabla = "XX"

in this case the program will be show a messge that rows is locked for other user.

Thank you.
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