select for update: a question [message #371525] |
Thu, 02 November 2000 09:35 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
christopher
Messages: 25 Registered: September 2000
|
Junior Member |
|
|
I would like to know whether the locks on all the rows selected by the "for update" clause in the select statement get released even though i don't update all of them.
|
|
|
Re: select for update: a question [message #371526 is a reply to message #371525] |
Thu, 02 November 2000 11:57 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
The locks are placed on all the rows targeted by the query and are unaffected by whether you update them or not. They locks are only release by commit or rollback. One subtle point is that the FK rows in child tables get locked too. If the FK's on the child tables are not indexed (they should be) then the whole child table is locked.
|
|
|
Re: select for update: a question [message #371550 is a reply to message #371526] |
Mon, 06 November 2000 10:46 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
John R
Messages: 156 Registered: March 2000
|
Senior Member |
|
|
An even subtler point is that if you list the columns that you wish to update, and that list doesn't include columns from the child tables, those tables aren't locked.
At least I think that's the case...
|
|
|