Solved

Select for update

Posted on 2004-03-23
9
159 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
unix in java example 9 52
micro services spring boot application error 3 141
split string containing \r\n in Java 46 38
arguments to jar 5 10
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

914 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now