468,272 Members | 1,999 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

changing the Isolation level

Hi everybody,

there are two ways to change the isolation level:

For instance i would like to change the isolation level to rs

1. "db2 change isolation to rs"
2. "db2 set current isolation rs"

When i use the first one and then "db2 values current isolation" to verify if the change was successful, i won't get anything. But when i use the second one and then invoke the command "db2 values current isolation", i will see that the isolation level is changed to rs.

Could anyone explain me please the difference between these two commands. Does it exist another way to verify the current isolation level?

Thanks in advance.

Best Regards,
May 6 '08 #1
3 3457
297 Expert 100+

you've forgotten one command:
Expand|Select|Wrap|Line Numbers
  1. someshell> db2 connect to mydbname
  2. someshell> db2 change isolation to rs
  3. someshell> db2 set current isolation rs
The first command is always a connect to your database, opening a session.

The 2nd one changes the isolation level for the current transaction which in this case is just "change isolation". You could integrate it into a text file, containing a couple of sql statements, and then run it with "db2 -vtf mysqlcmds.txt".

The 3rd one changes the isolation level for the current session. So every sql statement is affected as along as you're connected to the database.


May 7 '08 #2

thank you for you reply. But change isolation doesn't work when you are connected to the database, does it?

May 8 '08 #3
297 Expert 100+

yes, it is possible to change the iso level while connected to a database, when using a type 2 connection. If the desired iso level isn't supported by the database, it will escalate back to the iso level it had when connecting.

Find more information about changing the isolation level in the IBM docu.


May 8 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by Markus Breuer | last post: by
1 post views Thread by cwahlmeier | last post: by
9 posts views Thread by yu_sha | last post: by
3 posts views Thread by Eric Porter | last post: by
5 posts views Thread by m0002a | last post: by
3 posts views Thread by RG | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.