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 > concurrent access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-24-06, 10:24
supinformix supinformix is offline
Registered User
 
Join Date: Apr 2004
Location: Brussels
Posts: 57
concurrent access

We want the update thousands of rows in different tables with a stored procedure.
We've tried but didn't find how to lock the rows within a transaction on the select.
A "select for update" seems not to be permitted in SPL.
The sequence :
begin work;
set isolation to repatable read;
select * from xx where yy="date1" into temp table titi" ;
... other stuff ..
delete ...
insert ...
-----
When another process has a lock (select for update ..) on the row, The procedure can still select it, do the stuff ... and it will wait lockout on the delete.
If the other process has changed data, the procedure will erase it.
-----
How should we resolve this concurrent access ?
(aix4.3, IDS7.3ud6)
thanks,
yves
Reply With Quote
  #2 (permalink)  
Old 02-25-06, 15:33
linux linux is offline
Registered User
 
Join Date: Nov 2003
Location: sweden
Posts: 17
Quote:
Originally Posted by supinformix
We want the update thousands of rows in different tables with a stored procedure.
We've tried but didn't find how to lock the rows within a transaction on the select.
A "select for update" seems not to be permitted in SPL.
The sequence :
begin work;
set isolation to repatable read;
select * from xx where yy="date1" into temp table titi" ;
... other stuff ..
delete ...
insert ...
-----
When another process has a lock (select for update ..) on the row, The procedure can still select it, do the stuff ... and it will wait lockout on the delete.
If the other process has changed data, the procedure will erase it.
-----
How should we resolve this concurrent access ?
(aix4.3, IDS7.3ud6)
thanks,
yves
try this one
begin work ;
lock table table_name in exclusive mode;
__________________
Linux
Reply With Quote
  #3 (permalink)  
Old 03-02-06, 11:10
supinformix supinformix is offline
Registered User
 
Join Date: Apr 2004
Location: Brussels
Posts: 57
Wink

no
we want not to lock the table during hours.
Other users must have update access.
Concurrent access, you now.

BTW I' ve found a solution on the IIUG forum :
I had to do a dummy update in a transaction with an update cursor.
begin;
set isolation to repeatable read ;
foreach with cursor1 for select .....
update ... -- a dummy update on the row and it will be locked until commit
end foreach
... -- now my stuff with the real update
commit ; -- this will unlock
__________________
Yves & Willy
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