If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Changing Isolation level

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-14-10, 11:38
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Changing Isolation level

For what ever reason DB was created with a default, CS, isolation level. this is a warehouse db and there was no reason for this default. I see applications bumping into each other for no reason other then this setting.

I have never had to reset this parm for a whole db and looking now at the possibility of changing it. From everything that I have found it appears that I might be SOL as I can not find a way to permanently setting this level to UR as a new default.

I am not going to be able to convince app people to set it correctly on the fly. So, it has to be done at the DB level.

Is there a way to reset Isolation level with out a need of rebuilding db?

Thank you.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #2 (permalink)  
Old 04-14-10, 12:59
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You could change the default value in db2cli.ini:

IBM DB2 9.5 Information Center for Linux, UNIX, and Windows

Andy
Reply With Quote
  #3 (permalink)  
Old 04-14-10, 13:36
blazer789 blazer789 is offline
Registered User
 
Join Date: Jun 2009
Posts: 221
Does that mean db2cli.ini need to be changed on the database server OR on the client from which application is connecting ?
Reply With Quote
  #4 (permalink)  
Old 04-14-10, 13:38
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
It has to be on the client.

Andy
Reply With Quote
  #5 (permalink)  
Old 04-14-10, 14:14
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Thank you Andy.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #6 (permalink)  
Old 04-14-10, 15:02
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
A database cannot be created with any isolation level, and it cannot be set at the database level, because it is an attribute of a connection.

Also, I suspect db2cli.ini may have no effect on JDBC connections, if that's what your application uses.

Last edited by n_i; 04-14-10 at 15:06.
Reply With Quote
  #7 (permalink)  
Old 04-14-10, 15:15
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
it's a BIND command option
bind ... ISOLATION [CS|RR|RS|UR] ...
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #8 (permalink)  
Old 04-14-10, 15:46
blazer789 blazer789 is offline
Registered User
 
Join Date: Jun 2009
Posts: 221
For JDBC JCC Type-IV driver

You can set setTransactionIsolation method in the java.sql interface connection.
Reply With Quote
  #9 (permalink)  
Old 04-14-10, 16:57
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
I'm sure you've already seen this info but just in case:
IBM DB2 9.5 Information Center for Linux, UNIX, and Windows
Reply With Quote
  #10 (permalink)  
Old 04-15-10, 09:35
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Quote:
Originally Posted by n_i View Post
A database cannot be created with any isolation level, and it cannot be set at the database level, because it is an attribute of a connection.

Also, I suspect db2cli.ini may have no effect on JDBC connections, if that's what your application uses.
Nick,

AUTOCONFIGURE section of the db create allows to change the default value.

Bella, talk to someone. There got to be an easier way to change this setting globally.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #11 (permalink)  
Old 04-15-10, 09:58
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Alex, What you're trying to do (based on my understanding - set isolation level for all connections at the db level / db creation time) cannot be done.

autoconfigure calculates some config parameters based on info (including isolation level) you supply, but it doesn't set/change the isolation level for the database.
Reply With Quote
  #12 (permalink)  
Old 04-15-10, 10:55
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Quote:
Originally Posted by db2girl View Post
Alex, What you're trying to do (based on my understanding - set isolation level for all connections at the db level / db creation time) cannot be done.

autoconfigure calculates some config parameters based on info (including isolation level) you supply, but it doesn't set/change the isolation level for the database.
bella, I might be misreading the manual, but in Command Reference ver 9 page 402 states the following:"Isolation level of applications connecting to this database"

This tells me that if I provide this during the build all connection will be set at that level by default.

In the warehousing env where 99.9% of all activity is a SELECT queries and almost non existent daily updates I see no reason for CS isolation level.

Expecting developers to Code "with UR" or other means of resetting it, is like expecting to win a lottery. So, there would have been nice to have a parm where it can be set globally.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #13 (permalink)  
Old 04-15-10, 12:17
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by Cougar8000 View Post
Command Reference ver 9 page 402 states the following:"Isolation level of applications connecting to this database"

This tells me that if I provide this during the build all connection will be set at that level by default.
I think what it means is: "I'm expecting that my applications will set their isolation level to _whatever_ when connecting to the database, so please configure the database taking that into consideration".

In 9.7 you can set the cur_commit database configuration parameter to ON to modify behaviour of applications using the CS isolation level (which remains the default).
Reply With Quote
  #14 (permalink)  
Old 04-15-10, 13:25
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Nick,

Is there a lawyer in the house to decipher what that means

So when we finally make to 9.7 cur_commit will get set to DISABLED making UR a default, correct?
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #15 (permalink)  
Old 04-15-10, 13:39
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by Cougar8000 View Post

Is there a lawyer in the house to decipher what that means
No, just an English teacher

Quote:
Originally Posted by Cougar8000 View Post
So when we finally make to 9.7 cur_commit will get set to DISABLED making UR a default, correct?
If cur_commit is DISABLED, the behaviour of applications using "cursor stability" will revert to the original. It will still be the default isolation level.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On