View previous topic :: View next topic |
Author |
Message |
ravikumar_sri2001 Beginner

Joined: 06 Dec 2002 Posts: 117 Topics: 44 Location: Chennai,India
|
Posted: Fri Sep 05, 2014 1:40 am Post subject: Entire table locked for Tablespace scan ? |
|
|
Hi experts,
My application has a segmented table space and it has only one table in it.
LOCKSIZE is ANY. The program that is accessing this table is bound with isolation level CS and it executes a below query
Select max(col1) from xxx.yyy;
There is no index defined on column "col1".By looking into the PLAN_TABLE, i have confirmed that it is doing tablespace scan. My doubt is that, will DB2 acquire "S" lock on the table, (or), will it acquire "S" lock on page while inspecting the row in it and releases it when it examines the next page ?
I have searched the web before posting this query.
Thanks,
Ravikumar |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Sep 05, 2014 11:11 am Post subject: Re: Entire table locked for Tablespace scan ? |
|
|
ravikumar_sri2001 wrote: | My doubt is that, will DB2 acquire "S" lock on the table, (or), will it acquire "S" lock on page while inspecting the row in it and releases it when it examines the next page ?
I have searched the web before posting this query.
Thanks,
Ravikumar |
In your case DB2 will acquire an "S" lock on the table. The pages and rows locks are not acquired.
I suggest you read the share presentation The Keys to Understanding Locking for DB2 for zOS _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
ravikumar_sri2001 Beginner

Joined: 06 Dec 2002 Posts: 117 Topics: 44 Location: Chennai,India
|
Posted: Sat Sep 06, 2014 2:36 am Post subject: |
|
|
Kolusu,
Thank you so much for your help!
Once DB2 completes the above query, it will release "S" lock on the table immediately and it wont hold the lock until COMMIT right ???
Before initiating this thread I have gone thru link that you shared.
Thanks,
Ravikumar |
|
Back to top |
|
 |
|
|