Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2007

Tip: Looking for answers? Try searching our database.

A simple question:whether deadlcok will occur if db only select and     thers is no lock for reading

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
db2db2db2@gmail.com - 03 Dec 2007 18:48 GMT
it is a common question,not for db2,thank u very much
Mark A - 03 Dec 2007 20:44 GMT
> it is a common question,not for db2,thank u very much

When you do a select, there is a share lock, which could be part of a
lockwait or deadlock scenario if there are the right combination of other
exclusive locks (insert, update, delete, select for update, or certain
utililities).

Share locks by themselves, even if they occur from many applications on the
same row, do not conflict with eachother and cannot cause a lockwait or
deadlock situation without some other insert, update, delete, select for
update.

Not all databases work the same way in this regard, so the above applies to
DB2.
db2db2db2@gmail.com - 04 Dec 2007 00:10 GMT
thanks.
so your mean that only selecting will not cause deadlock using
db2,even there is a share lock
i know that there is no lock if only select records using oracle.
> <db2db2...@gmail.com> wrote in message
>
[quoted text clipped - 14 lines]
> Not all databases work the same way in this regard, so the above applies to
> DB2.
Knut Stolze - 05 Dec 2007 09:46 GMT
> so your mean that only selecting will not cause deadlock using
> db2,even there is a share lock

A share lock means that the resource being locked can be accessed by
different transactions together, i.e. they can "share" the resource.

Note, however, that some applications append the FOR UPDATE clause to SELECT
statements that do not explicitly contain FOR READ ONLY.  This is a really
bad idea but not something that can easily be changed.  (PHP is a good
example here.)

Signature

Knut Stolze
DB2 z/OS Utilities Development
IBM Germany

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.