473,699 Members | 2,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4368
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*****@sbcglo bal.net> schrieb im Newsbeitrag
news:JQ******** *********@newss vr15.news.prodi gy.com...
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*****@mobile audio.com> wrote in message
news:41******** **@corp.newsgro ups.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
8049
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 when to use one and not the other? For instance, if I wanted to remove an item in a SortedList, would it be better to lock() it or do it via the Synchronized wrapper? Why choose one over the other SortedList sl lock(sl sl.Remove(item) O
2
4466
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 locklist Lock Name = 0x020027011C0000000000000052 Lock Attributes = 0x00000000 Release Flags = 0x00000002 Lock Count = 1
5
7949
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, the auto commit is true. if the table has more than one row, i got row U lock, but if the table has only one row , i get row X lock, is this right, why is that? i would like this only create row U lock, not row X lock. thanks for advice
7
703
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 keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a
3
2676
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 thread that can set it. See code below for an overview. In a C or C++ environment, my current approach would be adequate (no need to acquire exclusive access to abortRequested). I'm guessing that I'm still OK under C# because bool is a value type....
14
6319
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 the ArrayList instance to the lock. But i still get the same exception. Thanks for your help. Sharon.
1
15654
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 someone is interested, let me know and I will send you the codes). Once we know if the stat of Num Lock/ Caps Lock is not what we desired, we just send the Num Lock / Caps Lock key to change the stat. From most of
8
2625
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 Object(); ...// some codes
20
1945
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 way to define the property below. Thanks Kurt Class1 { private Timer _timer = new Timer(); // Example 1
94
30309
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 Statement (C# Reference) statement to serialize access. " But when is it better to use "volatile" instead of "lock" ?
0
8689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8885
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6534
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2348
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.