Page 1 of 1

Using WITH UR in DB2.

Posted: Mon Mar 27, 2017 12:04 pm
by Akshypal
Hi,

Usually we are not allowed to use uncommited read in the COBOL programs. Then what is the purpose of using uncommitted read in DB2 SQL queries? Are there some advantages and disadvantages of it.

Re: Using WITH UR in DB2.

Posted: Tue Mar 28, 2017 3:19 am
by Robert Sample
One of the advantages is that it lets you know what the current state of the data is without waiting for locks to resolve. One big disadvantage is that a ROLLBACK may occur and hence change the current state of the data. Some companies, for example, let customers order an item as long as it is in stock (even if the uncommitted read shows somebody else is ordering the item; if that order completes then the company will issue a back-order letter to the other customer). There are times when it is convenient to know the current status of something, even though you know in an hour (minute, day, week ... whatever) the status will be different.

Re: Using WITH UR in DB2.

Posted: Wed Nov 15, 2017 5:34 pm
by Akshypal
Thanks Robert. I am thinking what can be the mainframe production scenarios for this. Thanks for your thoughts on this.