Understanding Locking in DB2 - IV

Read Part-I 

Read Part-II

Read Part-III

Lock duration

Lock Duration is a very important concept in locking when the lock states are not compatible with each other.This is the reason, you get those famous deadlock and timeout issues.So you should have sound knowledge of this concept before designing your program.

The duration of a lock is defined as the length of time a lock is held and varies according to the type of lock. Page or row locks are acquired when individual rows are accessed and are released at different times, depending on whether the data is accessed for read-only or for update and on the isolation level specified.High level locks are typically acquired implicitly, based on options specified at BIND or REBIND time.
Because DB2 does implicit high level locking, it is critical that the application designer understand the options that influence when high level locks are acquired, when they are released, and the state of the lock.

Duration of table space, partition, and table locks

Every plan executed in DB2 must acquire a high level lock that can either be a table space or partition lock and, if the table space is segmented, then a table lock as well. The exception this rule is that locks are not acquired on the table space or table if uncommitted read isolation is specified. However, DB2 does acquire a mass delete lock. A mass delete is when a DELETE statement is executed with no WHERE clause such that all rows are deleted. DB2 uses the mass delete lock to serialize a mass delete process with an uncommitted reader.

DB2 provides options to control the point at which the high level locks are requested.

The BIND and REBIND options ACQUIRE and RELEASE is used to control when the high level locks are taken and released.

The possible values for the ACQUIRE option are ALLOCATE and USE. If you use ACQUIRE(ALLOCATE), all of the needed locks on all of the table spaces, partitions, and tables used by the plan are acquired at the first SQL call. If you use ACQUIRE(USE), only the needed locks on the table spaces, partitions, and tables are acquired for a shorter time, as and when the objects are accessed.

DB2 packages and dynamic SQL always use ACQUIRE(USE).

The time when the high level locks are released is influenced by the RELEASE option. The possible values for this option are DEALLOCATE and COMMIT. If you use RELEASE(DEALLOCATE), the locks are released only when the thread terminates. If you use RELEASE(COMMIT), the locks are released at commit time unless there are held cursors.


Duration of page or row locks

The duration of page or row locks depends on whether they are acquired and released in a read-only or read and write environment.

Read-only

BIND and REBIND ISOLATION option controls when page or row locks are acquired and released in a read-only environment.

The duration and number of page or row locks depend on the nature of the process and the value for the ISOLATION option specified at BIND or REBIND. The most common ISOLATION option is cursor stability (CS), which is the default as of DB2 9 for z/OS. With cursor stability as the ISOLATION option, DB2 returns committed data and provides stability of data under updateable cursors. If a query is answered through a work file,

For example, a concurrent thread may update the data in the database that generated the data in the work
file.The repeatable read (RR) isolation retains page locks even though the process logic moves through several pages in the same table during a unit of work. If the pages are accessed again, repeatable read provides repeatability: the data cannot be changed by any other concurrent process. This is true for read stability isolation also.

Read and write

A process that uses a cursor adds another dimension to locking. Pages read acquire a U-lock, initially indicating update intent. But before a column can be updated or a row can be deleted, the U-lock on the page is changed to an X-lock and is released at commit.


Here we come to an end of this Understanding of locking series.I will explain Isolation level in detail in different post as this topic deserve it, due to its immense importance to the programmer.Then there are various other important concept in terms of locking as lock avoidance,timeout,deadlock etc. which will be covered in coming posts.

89 comments:

Anonymous said...

Incredible story there. What occurred after? Good luck!
My web page - blackjack for real money

Anonymous said...

This is my first time pay a visit at here and i am truly pleassant to read
all at single place.
Also visit my web site : real money slot machines

Anonymous said...

Hey! Someone in my Facebook group shared this site with us so I came to check it out.
I'm definitely enjoying the information. I'm bookmarking and will be tweeting this
to my followers! Fantastic blog and amazing design and style.
Feel free to visit my web blog ; online casino bcjecjh http://bestonlinecasinoworld.tumblr.com/

Anonymous said...

When someone writes an piece of writing he/she keeps the image of a user in his/her brain that how a user
can know it. Therefore that's why this paragraph is outstdanding. Thanks!
My web site ; www.tdameritrade.com

Anonymous said...

I do not even know how I ended up here, but I thought this post was great.

I don't know who you are but definitely you are going to a famous blogger if you are not already ;) Cheers!
Also see my site :: best Online casino Usa

Anonymous said...

Hey! This is my 1st comment here so I just wanted to give a quick shout out and tell
you I really enjoy reading through your posts.
Can you recommend any other blogs/websites/forums that go over the same topics?
Thanks!
Stop by my weblog ... play online slots for money

Anonymous said...

It's awesome to go to see this web page and reading the views of all colleagues regarding this piece of writing, while I am also zealous of getting experience.
Here is my homepage ; real money slots online

Anonymous said...

Does your site have a contact page? I'm having problems locating it but, I'd like to shoot
you an e-mail. I've got some creative ideas for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it improve over time.
Also visit my web-site :: online stock trading reviews

Anonymous said...

Unquestionably believe that which you stated. Your favorite reason appeared to be on the web the easiest thing to be aware of.
I say to you, I definitely get annoyed while people consider worries that they plainly
don't know about. You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people could take a signal. Will probably be back to get more. Thanks
Here is my page ; affiliate marketing programs

Anonymous said...

I love what you guys are up too. This sort of clever work and reporting!
Keep up the wonderful works guys I've incorporated you guys to my personal blogroll.
Look into my weblog roulette for real money

Anonymous said...

Thank you for the auspicious writeup. It if truth be told used to be a amusement
account it. Look complicated to more delivered agreeable from you!

By the way, how can we be in contact?
Also visit my web-site : affiliate internet marketing

Anonymous said...

I was recommended this blog by my cousin. I am not sure whether this
post is written by him as nobody else know such detailed about my
problem. You are wonderful! Thanks!
my website - free slots for real cash

Anonymous said...

I blog quite often and I truly appreciate your information.

The article has truly peaked my interest. I'm going to bookmark your website and keep checking for new details about once per week. I subscribed to your RSS feed too.
Feel free to surf my web blog - forex binary options trading

Anonymous said...

I absolutely love your blog and find many of your post's to be exactly I'm looking for.
Does one offer guest writers to write content for you?
I wouldn't mind producing a post or elaborating on a few of the subjects you write with regards to here. Again, awesome blog!
Feel free to visit my web-site ... play real slots online

Anonymous said...

Wow, that's what I was searching for, what a stuff! present here at this web site, thanks admin of this website.
Also visit my weblog roulette online real money

Anonymous said...

Hello, for all time i used to check website posts here in the
early hours in the dawn, since i love to gain knowledge of more and more.
Feel free to visit my webpage - make money online fast and free

Anonymous said...

4, it thаt you are alone. It juѕt doesn't support it. My friends are in the caves any more personal" Trim Style" aligns with their mates free dating. Quotes back up straight and relaxed look on your after-work life.

my website - szse.hu

Anonymous said...

Tіps for Free dating eх-husbands.

Be respectful during your datе, ask questіοns about
Demi. Our members аre focuѕed on meeting me.

Thiѕ is not veгy perceptive or nοt Ι hope tο be involveԁ with one another and next thing that we both dislike it when.

Anonymous said...

These meаls are esѕential nutrients or whatsoеνer уe do,
to whіch they need from food, non-proсеssed ingгediеnts.
6 eight-ounce glаsses of water at lеaѕt 15 inсheѕ hіgh.
W Ѕіmeons iѕ the Bеѕt Weight Loss by Increaѕіng
ΜеtаbolіsmЅince musсle burns 50 сaloriеs a
day. Τhat wау you are likеly
to be аn еxtrеme ԁiet?

Mу wеbsite; Mygreencoffeeweightloss.net

Anonymous said...

Ηowevеr, we think іts timе to buy.
On that day, the сurrеncy fluctuatіon.
Digіtаl dгawing/painting and/οг photos аre another categorу.
The latest fall came aѕ Free Dating іn Zynga, the
sоciаl medial gіаnt hаd expected Fгee Dating would ѕеll for $28 to $35 a share.
The industries you expect to impгoνe
уouг site. Using cash to levеrage іs
much mоre lіkely that some form of businеss Cοmρany form οf organization
oсcuрies a рivotal plaсe in the U.
Howеver, Mr Ѕaunders is less cοmplimentary about two giаnts of the sеctor.



Feel free to surf to my web blog http://2datingtoday.net/

Anonymous said...

Not even Mг Dimon ѕοunԁed moгe humble, saуing that
the economy had not completely recoverеd from the well,
but diѕарpointeԁ with a dry well last
month ѕending its fгee dаtіng tumbling over 20%. Reaching to a selected and reputed broker would surely be beneficial in a number of voyages to various places. Investing in stocks and Free Dating for Jefferies & Company. free dating of cement manufacturing companies can go down. Besides that, shares that have gained a 50 per cent of the vote.

Also visit my blog post: 1datingintheusa.com

Anonymous said...

Currently it sounds like Drupal is the top blogging platform available
right now. (from what I've read) Is that what you are using on your blog?

My web blog; legit ways to make money on the internet
My web site :: legit ways to make money at home

Anonymous said...

Hello friends, pleasant paragraph and good urging commented here, I am in fact enjoying
by these.

My webpage what is day trading

Anonymous said...

Hello, its fastidious post concerning media print, we all know media is a impressive source of facts.


Here is my webpage; binary options Reviews
Also see my web site: binary options trading system

Anonymous said...

My family members every time say that I am wasting my time here at web,
except I know I am getting know-how all the time by reading thes nice articles.


Here is my page: binary options broker

Anonymous said...

Attractive section of content. I just stumbled upon your site and in accession capital to assert
that I get actually enjoyed account your blog posts.

Any way I will be subscribing to your feeds and even I achievement
you access consistently fast.

My web blog; binary options

Anonymous said...

An outstanding share! I've just forwarded this onto a friend who had been doing a little homework on this. And he actually ordered me breakfast because I discovered it for him... lol. So let me reword this.... Thank YOU for the meal!! But yeah, thanks for spending some time to talk about this topic here on your web page.

Here is my weblog: how do you get your money from cedar finance
my site > forex live trading

Anonymous said...

I believe what you typed was very logical. But, consider this, suppose you composed a catchier title?
I am not suggesting your information isn't solid, but suppose you added a post title to maybe grab people's attention?
I mean "Understanding Locking in DB2 - IV" is kinda plain.
You could look at Yahoo's home page and note how they create article headlines to get viewers to open the links. You might add a related video or a pic or two to get readers excited about what you've written.

In my opinion, it would make your posts a little bit more
interesting.

Here is my page: binary options india

Anonymous said...

I think the admin of this site is really working hard in favor of his site, as here every data is quality based
material.

Feel free to visit my web page cedar finaance

Anonymous said...

Excellent article! We are linking to this particularly great content on our site.
Keep up the great writing.

Take a look at my site: Geld Zu verdienen

Anonymous said...

Thank you for the auspicious writeup. It actually was a entertainment
account it. Glance complicated to more brought agreeable from you!
By the way, how could we communicate?

Feel free to surf to my web site: cedar finance password requirements

Anonymous said...

I enjoy what you guys tend to be up too. This type of clever work and reporting!
Keep up the great works guys I've you guys to blogroll.

my blog post; Forex binary Options

Anonymous said...

Very soon this site will be famous amid all blogging visitors, due to it's nice content

Feel free to visit my site: list of penny stocks

Anonymous said...

Very soon this site will be famous amid all blogging visitors,
due to it's nice content

Check out my web-site :: list of penny stocks
my webpage :: cedar finance binary options

Anonymous said...

I’m not that much of a online reader to be honest but
your sites really nice, keep it up! I'll go ahead and bookmark your website to come back later. Cheers

My site: binary Options Trading Strategy

Anonymous said...

I like what you guys are up too. This sort of clever work and exposure!
Keep up the wonderful works guys I've included you guys to our blogroll.

Here is my blog post: binary options systems

Anonymous said...

It's a shame you don't have a donate button!

I'd certainly donate to this outstanding blog! I suppose for now i'll settle for
bookmarking and adding your RSS feed to my Google account.
I look forward to fresh updates and will talk about this blog with my
Facebook group. Talk soon!

Feel free to surf to my web blog :: im internet geld verdienen

Anonymous said...

Hello! I could have sworn I've been to this website before but after checking through some of the post I realized it's new to me.
Anyways, I'm definitely glad I found it and I'll be bookmarking and checking back frequently!


Also visit my webpage ... What Are Binary Options

Anonymous said...

After exploring a few of the blog articles on your website, I truly like your way of blogging.

I book-marked it to my bookmark site list and will be
checking back in the near future. Please check out
my website as well and tell me what you think.

Also visit my web site ... one touch binary options

Anonymous said...

These are actually fantastic ideas in about blogging.
You have touched some fastidious points here. Any way keep up wrinting.


Have a look at my web-site: forex day trading systems
My web page :: cedar finance minimum to start

Anonymous said...

Hi there, You have done an incredible job. I will definitely digg it and personally recommend to my friends.
I am sure they will be benefited from this web
site.

Here is my weblog - slots real money

Anonymous said...

Wow, marvelous blog format! How lengthy have you ever been running a blog for?
you make running a blog look easy. The full look of your site is great, as
neatly as the content material!

My site - jacks or better

Anonymous said...

Hey there, You've done a fantastic job. I'll certainly
digg it and personally suggest to my friends. I am confident they'll be benefited from this web site.

Here is my web-site ways to make extra money from home

Anonymous said...

I was able to find good advice from your content.



Here is my web blog; 100 ways to make money

Anonymous said...

I pay a quick visit day-to-day some web pages and websites to read
content, however this website provides quality based articles.



Take a look at my webpage :: ways to make fast easy money

Anonymous said...

Pretty nice post. I just stumbled upon your blog and wanted to
say that I've really enjoyed browsing your blog posts. In any case I'll be subscribing to
your rss feed and I hope you write again very soon!

My homepage get rich

Anonymous said...

Pretty nice post. I just stumbled upon your weblog and wished to
say that I've truly enjoyed browsing your blog posts. After all I'll be subscribing to your rss feed and I hope you write again soon!



Here is my page ... online work at home

Anonymous said...

Thanks for your marvelous posting! I certainly enjoyed reading it, you might be a great author.
I will make certain to bookmark your blog
and will eventually come back sometime soon.
I want to encourage you to definitely continue your great
posts, have a nice afternoon!

My web-site ... gold trade online
My web page: gold trade

Anonymous said...

I am actually delighted to read this webpage posts which contains plenty of useful information, thanks for providing such information.


Here is my web site: make real money online

Anonymous said...

Fine way of describing, and fastidious piece of writing
to take information concerning my presentation subject,
which i am going to deliver in school.

Look into my web blog :: Stock trading software review

Anonymous said...

It's nearly impossible to find educated people about this topic, but you seem like you know what you're talking about!
Thanks

Feel free to surf to my homepage ... free online bonus slots

Anonymous said...

I just like the valuable information you provide to your articles.

I will bookmark your blog and check again right here frequently.
I'm somewhat certain I will learn many new stuff right here! Good luck for the next!

Here is my weblog; Easy ways to make money

Anonymous said...

Hey! This is my first comment here so I just wanted to give
a quick shout out and say I truly enjoy reading through your blog posts.
Can you recommend any other blogs/websites/forums that cover the same topics?
Appreciate it!

Here is my weblog; how to make money online

Anonymous said...

Just desire to say your article is as amazing. The clarity in your post is just cool and i can assume you are an expert on this subject.
Fine with your permission allow me to grab your feed
to keep up to date with forthcoming post. Thanks a million and please continue the enjoyable work.


Also visit my website :: teaching english online jobs

Anonymous said...

Touche. Solid arguments. Keep up the great work.



Here is my webpage ... simple ways to make money

Anonymous said...

Hey there just wanted to give you a brief heads up and let
you know a few of the images aren't loading correctly. I'm not
sure why but I think its a linking issue. I've tried it in two different web browsers and both show the same outcome.

Check out my site: Work at Home business Online Opportunity

Anonymous said...

Howdy! I realize this is somewhat off-topic but I needed to ask.
Does running a well-established website like yours take a large amount of work?

I am completely new to blogging however I do write in my journal everyday.
I'd like to start a blog so I can share my own experience and views online. Please let me know if you have any ideas or tips for new aspiring bloggers. Appreciate it!

Also visit my web page easy online jobs for students

Anonymous said...

Thanks for sharing your thoughts. I truly appreciate your efforts and I am waiting for your next post thank you once again.


Feel free to visit my web-site :: easy jobs

Anonymous said...

Wow, wonderful weblog structure! How long have you been running a blog for?
you make blogging look easy. The whole glance of your web site is magnificent, let alone the content material!


Here is my web page work at home Jobs

Anonymous said...

It is really a great and helpful piece of info. I am happy that
you shared this helpful information with us. Please stay us informed like this.

Thank you for sharing.

Also visit my page: Day trading software

Anonymous said...

Hello, i read your blog occasionally and i own a similar one and i was just wondering if
you get a lot of spam remarks? If so how do you prevent it, any plugin
or anything you can advise? I get so much lately
it's driving me mad so any assistance is very much appreciated.

Stop by my homepage - apply to jobs online

Anonymous said...

What a material of un-ambiguity and preserveness of
valuable knowledge about unpredicted feelings.


My blog post :: usa online casinos for usa players

Anonymous said...

I'm not sure why but this blog is loading very slow for me. Is anyone else having this issue or is it a issue on my end? I'll check back later on and see if the problem still exists.


Also visit my blog ... slot free game

Anonymous said...

always i used to read smaller content which also clear their motive,
and that is also happening with this paragraph
which I am reading now.

Look at my website Cnn After Hours Trading

Anonymous said...

Thank you for the auspicious writeup. It in fact was a amusement account it.
Look advanced to more added agreeable from you! However,
how could we communicate?

Also visit my web site good ways to make money

Anonymous said...

Wow! This blog looks exactly like my old one! It's on a entirely different topic but it has pretty much the same layout and design. Excellent choice of colors!

my webpage ... http://www.youtube.com/watch?v=MN36K29q7_Q

Anonymous said...

Paragraph writing is also a excitement, if you know afterward you can write if not it is complicated to write.


Feel free to visit my page: http://www.youtube.com/watch?v=xXaJhdwZIpA

Anonymous said...

Hello! This post could not be written any better! Reading through this post reminds me of my good old room mate!
He always kept chatting about this. I will forward this write-up to him.
Fairly certain he will have a good read.

Many thanks for sharing!

Look into my web blog :: money making jobs online

Anonymous said...

I think the admin of this site is really working hard in support of his
website, since here every data is quality based stuff.


My web-site; ways to earn money fast

Anonymous said...

Nice post. I used to be checking constantly this weblog and I'm inspired! Extremely useful information particularly the final section :) I deal with such information a lot. I used to be seeking this particular info for a very long time. Thank you and best of luck.

my weblog :: i need money in 1 Hour

Anonymous said...

This is a really good tip particularly to those new to the
blogosphere. Simple but very accurate information… Thank you for sharing this one.

A must read article!

my webpage ... money online earn

Anonymous said...

Why users still make use of to read news papers when in this technological globe everything is available on web?


my web page; how to make money at home for free

Anonymous said...

Why users still make use of to read news papers when in this technological globe everything is available on web?


Also visit my web-site ... how to make money at home for free

Anonymous said...

What's up, just wanted to say, I liked this post. It was inspiring. Keep on posting!

My blog - how to make money from home on the internet

Anonymous said...

I like the helpful information you provide in your articles.
I'll bookmark your weblog and check again here regularly. I'm quite
sure I'll learn a lot of new stuff right here! Good luck for the next!

my web page ... find restaurant jobs

Anonymous said...

Undeniably imagine that that you said. Your favourite justification seemed
to be at the internet the easiest factor to take note of.
I say to you, I definitely get irked whilst people consider issues that they just
don't know about. You controlled to hit the nail upon the highest as well as outlined out the whole thing without having side effect , people can take a signal. Will likely be again to get more. Thank you

Stop by my blog Online forex trading software

Anonymous said...

Hi there, I discovered your site by means of Google while searching for
a related subject, your site got here up, it appears to be like good.
I've bookmarked it in my google bookmarks.
Hi there, just became alert to your weblog through Google, and found that it's really informative.

I'm gonna watch out for brussels. I'll be grateful when you proceed this in future.
Lots of other people will be benefited from your writing.
Cheers!

Also visit my web site ... stock market trading hours

Anonymous said...

It's an remarkable post for all the internet users; they will obtain advantage from it I am sure.

My blog post - cedar financial binary

Anonymous said...

Greetings! Very helpful advice within this article! It is the little changes that will make the largest changes.
Thanks a lot for sharing!

Here is my page: cedar financial

Anonymous said...

It is the best time to make some plans for the future
and it is time to be happy. I have read this post and if I could I
desire to suggest you few interesting things or advice.
Perhaps you can write next articles referring to this article.
I desire to read even more things about it!

Check out my site :: http://www.youtube.com/watch?v=yWtQw9OzNwY

Anonymous said...

This design is steller! You definitely know how to keep a reader entertained.
Between your wit and your videos, I was almost moved to start my own blog (well,
almost...HaHa!) Excellent job. I really loved what you had to say, and
more than that, how you presented it. Too cool!


Review my homepage; make money fast

Anonymous said...

I am actually happy to glance at this webpage posts which includes lots of useful
facts, thanks for providing these data.

Here is my blog post - http://www.youtube.com/watch?v=gtCm82Itxoc

Anonymous said...

Hey I know this is off topic but I was wondering if
you knew of any widgets I could add to my blog that automatically tweet
my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

Also visit my weblog http://www.youtube.com/watch?v=Al2XPf2DgwE

Anonymous said...

Incredible points. Great arguments. Keep up the great spirit.


Also visit my site: make money fast online

Anonymous said...

Howdy, I ԁo believe your blοg may be haνing web browser compatibility issues.
Whenever I take a look at your blog in Safaгi,
it looks fine but when opening in IE, it's got some overlapping issues. I just wanted to give you a quick heads up! Other than that, wonderful website! best dvd ripping software free 2012 - rippln mobile - rippln mobile

Anonymous said...

Wow! Finally I got a website from where I
be capable of genuinely get useful facts concerning my study and knowledge.



Also visit my website; http://www.pregnancyhelper.in

Anonymous said...

What's up to all, the contents existing at this web site are truly amazing for people experience, well, keep up the good work fellows.

my weblog - based business

Anonymous said...

I quite like reading through an article that can make men and women think.
Also, thank you for permitting me to comment!

My web-site optionbinaire

Blogger said...

Did you know that you can earn cash by locking selected pages of your blog or site?
To begin you need to join AdscendMedia and run their Content Locking widget.

Post a Comment