Solved

Select for update

Posted on 2004-03-23
9
164 Views
Last Modified: 2010-03-31
When using select for update, if the update is in a different transaction, will the lock on the row selected be released when the first transaction ends or when the second one ends? What happens if an error occurs and the first transaction is never closed?
0
Comment
Question by:authenticate
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 10661941
Maybe you'd like to address the question i asked at the end of your last one authenticate...?
0
 
LVL 35

Accepted Solution

by:
girionis earned 168 total points
ID: 10662023
A select does not lock the row, only an update or an insert locks it and should be released upon calling commit.

> What happens if an error occurs and the first transaction is never closed?

The transaction will roll back so it will eventually be in it's original state.

0
 
LVL 92

Assisted Solution

by:objects
objects earned 166 total points
ID: 10662030

The tx will end when you end it or roll it back.
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 9

Assisted Solution

by:mmuruganandam
mmuruganandam earned 166 total points
ID: 10664679
Whenever you are using the "select for update" that row(s) will be locked.  
Unless that transaction successfully ends/rollbacked, no other transaction can update that row(s).


Regards,
Muruga
0
 
LVL 35

Expert Comment

by:girionis
ID: 10858800
I believe points should be split between all the participants.
0
 
LVL 92

Expert Comment

by:objects
ID: 10864627
split between girionis, objects and mmuruganandam.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question