changing the Isolation level

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maryan
    New Member
    • Feb 2008
    • 15

    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,
    Maryan
  • docdiesel
    Recognized Expert Contributor
    • Aug 2007
    • 297

    #2
    Hi,

    you've forgotten one command:
    Code:
    someshell> db2 connect to [I]mydbname[/I]
    someshell> db2 change isolation to rs
    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.

    Regards,

    Bernd

    Comment

    • Maryan
      New Member
      • Feb 2008
      • 15

      #3
      Hello,

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

      thanks,
      Maryan

      Comment

      • docdiesel
        Recognized Expert Contributor
        • Aug 2007
        • 297

        #4
        Hi,

        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.

        Regards,

        Bernd

        Comment

        Working...