Solved

Select for update

Posted on 2004-03-23
9
160 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 96
jar file executable 12 52
java stored proc example 9 31
jsp insert to database example 2 24
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

778 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