473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

lock conversion U-Locks

hi,

i am writing a thesis on the concurrency control in db2 udb and oracle. I
found in the documentary of db2, that
a resource holding a (U)pdate-Lock can still be requested by a read-lock
(e.g. S). If the U-Lock wants to convert to a write-lock, does the
transaction have to wait for the transaction with the S-lock to finish ? Can
it starve ? Is this the symmetric RUX-Protocoll ? Questions, so many
questions ...

Thx.

Christoph Zeltner
Nov 12 '05 #1
4 4348
Yes, U lock is compatible with S lock. Because U lock will be promoted to X
lock, instead of asking for S and X lock separately to search and update the
target object, this can avoid deadlock in some cases.

"Christoph Zeltner" <ch***************@web.de> wrote in message
news:cd*************@news.t-online.com...
hi,

i am writing a thesis on the concurrency control in db2 udb and oracle. I
found in the documentary of db2, that
a resource holding a (U)pdate-Lock can still be requested by a read-lock
(e.g. S). If the U-Lock wants to convert to a write-lock, does the
transaction have to wait for the transaction with the S-lock to finish ? Can it starve ? Is this the symmetric RUX-Protocoll ? Questions, so many
questions ...

Thx.

Christoph Zeltner

Nov 12 '05 #2
Thank you for your answer. If a transaction has an U-lock and another
transaction has a S-lock on the same resource, what happens, if the U-lock
wants to promot to a X-lock ? Does it have to wait for the S-lock (i think
so) ? So can a promotion starve ? Very low down in the internals, i know,
but maybe you know that.

Thx
Christoph
"Fan Ruo Xin" <fa*****@sbcglobal.net> schrieb im Newsbeitrag
news:JQ*****************@newssvr15.news.prodigy.co m...
Yes, U lock is compatible with S lock. Because U lock will be promoted to X lock, instead of asking for S and X lock separately to search and update the target object, this can avoid deadlock in some cases.

"Christoph Zeltner" <ch***************@web.de> wrote in message
news:cd*************@news.t-online.com...
hi,

i am writing a thesis on the concurrency control in db2 udb and oracle. I found in the documentary of db2, that
a resource holding a (U)pdate-Lock can still be requested by a read-lock (e.g. S). If the U-Lock wants to convert to a write-lock, does the
transaction have to wait for the transaction with the S-lock to finish ?

Can
it starve ? Is this the symmetric RUX-Protocoll ? Questions, so many
questions ...

Thx.

Christoph Zeltner


Nov 12 '05 #3
Ian
Christoph Zeltner wrote:
Thank you for your answer. If a transaction has an U-lock and another
transaction has a S-lock on the same resource, what happens, if the U-lock
wants to promot to a X-lock ? Does it have to wait for the S-lock (i think
so) ? So can a promotion starve ? Very low down in the internals, i know,
but maybe you know that.


Yes, the change from a U-lock to an X-lock will wait for the S-lock to
be released. DB2 has a configuration parameter that controls how long
an application will wait for a lock before timing out.

You can read more about this in the DB2 UDB documentation. See:

http://tinyurl.com/46myf
For more information about locks (and links to other pieces of doc

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #4
Ian is right. The U-lock will be promoted to X lock only after all the other
S locks are released. But I thought the U-lock will wait forever until it
can be promoted to X lock, no matter what LOCKTIMEOUT db parameter you
setup. (Maybe I got wrong, I am not totally sure about this. You can do a
test).
There is always some comprise between high concurrency and data integrity.
This is an very old concurrency control policy, it is used during the time
when the dbms are used by highly intensive data update OLTP applications.
Most systems are client/server two tier architecture or earlier like
Mainframe. Since web/internet applications are accepted by more and more
systems. All the dbms producer become to adjust their concurrency control
policy in order to handle the demands of a growing number of concurrent
application requests. IBM has been doing a lot of improvement on this issue.
But it looks like the documentation didn't cover those new parts.

"Ian" <ia*****@mobileaudio.com> wrote in message
news:41**********@corp.newsgroups.com...
Christoph Zeltner wrote:
Thank you for your answer. If a transaction has an U-lock and another
transaction has a S-lock on the same resource, what happens, if the U-lock wants to promot to a X-lock ? Does it have to wait for the S-lock (i think so) ? So can a promotion starve ? Very low down in the internals, i know, but maybe you know that.


Yes, the change from a U-lock to an X-lock will wait for the S-lock to
be released. DB2 has a configuration parameter that controls how long
an application will wait for a lock before timing out.

You can read more about this in the DB2 UDB documentation. See:

http://tinyurl.com/46myf
For more information about locks (and links to other pieces of doc

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rich Sienkiewicz | last post by:
Some classes, like Queue and SortedList, have a Synchronized method which gives a thread safe wrapper object for these classes. But the lock() statement does the same thing. Is there any rules as to...
2
by: xixi | last post by:
i am using type 4 driver with fp3 on windows 64bit server, auto commit is true, cursor is CS type. i have a sensitive , updatable cursor open and bring back a one row resultset, i get this...
5
by: xixi | last post by:
hi, i am using db2 udb v8.1 on windows, i create a index on a unique value column on a table to try to create row lock, here is what i do , sql = select value from table where id=1 for update,...
7
by: Sunny | last post by:
Hi, I can not understend completely the lock statement. Actally what is locked: 1. the part of the code between {...} or 2. the object in lock() In the docs is written: for 1: The lock...
3
by: Invalid | last post by:
I launch a worker thread that periodically reads a volatile bool abortRequested, which could be set to true by my main form. IOW, there is one thread that can read that bool and one different...
14
by: Sharon | last post by:
Hi all. I have an ArrayList and sometimes while enumerating through, i get an exception because another thread has added to the ArrayList. To solve this problem, i lock the enumeration, passing...
1
by: charlies224 | last post by:
Hi, I am writting a software that requires me to make sure the Num Lock is always on and Caps Lock is always off. First, I know how to detect if Num Lock or Caps Lock is on or off (if...
8
by: nytimescnn | last post by:
I've read some discuession about lock() for thread-safe. I am wondering what will be the differce between below two code segment? Code 1: class A { private static Object padlock = new...
20
by: Kurt | last post by:
Below is a class that can accessed from multiple threads and I want the class to be thread safe. I have a private timer member whose interval can be changed by different threads. Which is the correct...
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.