Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2017
    Posts
    1

    Unanswered: How to avoid DB2 locks and "with UR" sentence

    In order to avoid DB2 locks when executing a query I use the sentence "with ur". However, I could forget that sentence and create a problem in the database becasue of locks.

    Is there any way to ensure that the DB2 will not be locked although I forgot that sentence?

    Thanks

  2. #2
    Join Date
    Dec 2013
    Location
    The Great State of South Dakota
    Posts
    6
    If you are using the Db2 command prompt the command SET CURRENT ISOLATION UR will establish the isolation level for the session.

    https://www.ibm.com/support/knowledg.../r0010944.html

  3. #3
    Join Date
    Apr 2012
    Posts
    1,143
    Provided Answers: 27
    If your client-applications use jdbc to connect to DB2, you can configure the data-sources with additional properties on the connection-string to choose the default isolation.
    If your client-applications use ODBC, there are equivalent settings for the DSNs to achieve the same result, in db2cli.ini or elsewhere.

    But beware, depending on the nature of your application, unconditionally setting the default isolation to UR can give the wrong functional results, which can negatively impact your business.

  4. #4
    Join Date
    Oct 2007
    Posts
    161
    Provided Answers: 9
    you can do the same with QMF and SPUFI on the mainframe as well, by binding the package WITH UR

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •