Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is Possible... (Pessimistic Locks) 1

Status
Not open for further replies.

Hattusas

Programmer
Nov 11, 2001
344
TR
to obtain a read (dirty read) from a table while someone is
deleting row(s) from the same table?
We are using java applications to make transactions but when we are trying to delete some records the other connections fall into lock-wait state (but we are %100 sure that the others want to read the records only;even dirty read would be OK...)
Any suggestions?

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
You can use
Code:
SELECT blah FROM x
   WHERE conditions
WITH UR;
to your other queries. 'UR' means uncommited read, i.e. a dirty read.

Caveat: there is no guarantee that what you read will be either consistent with the rest of the database, or even that it will even be committed or rolled back. But it doesn't take any locks, so it might be what you need.
 
It seems extremely logical. I will try it as soon as possible.Thanks

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
turkey_clr.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top