Solved

Select for update

Posted on 2004-03-23
9
163 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
fibonacci ten numbers 4 54
SequenceInputStream example 3 22
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 46
swing controls 2 24
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

730 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