Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using UR in the code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Mon Jul 27, 2009 5:12 pm    Post subject: Using UR in the code
Reply with quote

Dear Friends,
If we use UR in the program for some certain queries and if the program execution is over then will it again continue with UR level?

If suppose the transaction level is of RR and im setting the transaction level to UR in the program and if once the program execution is over will it automatically switch over to RR or it will stay as UR since we have set the transaction level to UR....
Back to top
View user's profile Send private message

Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Mon Jul 27, 2009 5:47 pm    Post subject:
Reply with quote

Sorry to Rephrase this question.

What is the difference between providing the Isolation level during the Bind and providing a isolation levels inside the code?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jul 27, 2009 6:00 pm    Post subject:
Reply with quote

I believe that the ISOLATION Level you use in your imbedded sql statement is only 'active/valid' for that query. Thus you could have two selects in your program, one with UR the other without. With RR in the bind, the one without UR will always execute as RR and the one with UR will always execute with UR.
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 186
Location: chennai

PostPosted: Mon Jul 27, 2009 10:42 pm    Post subject: Reply to: Using UR in the code
Reply with quote

Hi Manigandan

The ISOLATION level in the SQL will bypass the ISOLATION level in the BIND.

Regards
Raghu
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Jul 28, 2009 12:07 pm    Post subject:
Reply with quote

Thanks a lot.... icon_smile.gif
Is there any difference in order by clause in the SQLs with the isolation level UR??
or is there any syntax in DB2 that it will return different result for Uncommited read??
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Jul 28, 2009 1:50 pm    Post subject:
Reply with quote

Quote:
Is there any difference in order by clause in the SQLs with the isolation level UR??

No.


Quote:
or is there any syntax in DB2 that it will return different result for Uncommited read??


The results obtained by having WITH UR may differ from other Isolation levels I believe.
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Jul 28, 2009 2:14 pm    Post subject:
Reply with quote

Ya thats what exactly i need to know whether the results will differ when comparing to other isolation levels with UR??

Lets keep the database in Read only mode and if we compare the results with UR and isolation levels then will it differ the results??
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Jul 28, 2009 3:49 pm    Post subject:
Reply with quote

If there are no data modification statements, then the result of a query will be same irrespective of the isolation levels.

Lets not make this a question and answers session. Please come up with what exactly are you trying to achieve. Lets talk about solutions.
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Jul 28, 2009 5:48 pm    Post subject:
Reply with quote

Our Database will be in read only mode...at certain times and during those periods there are some jobs to be executed. At present these jobs are bound with the CS isolation level.......and we are planning to convert it in to UR level..................we have concern here is that whether the results retrieved will be different from CS level.......
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Jul 28, 2009 6:30 pm    Post subject:
Reply with quote

Quote:
If there are no data modification statements, then the result of a query will be same irrespective of the isolation levels.


But, If there is a chance of data modification statements, the results may differ.

WITH UR fetches all the rows matching the where clause which may not even be committed. But CS will fetch all the rows that are committed.
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Wed Jul 29, 2009 11:47 am    Post subject:
Reply with quote

Agreed. But since the database is in read only mode i beleive that there might not be any problem to change the isolation level from CS to UR..

Just need your inputs/comments on this statement
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Jul 29, 2009 12:31 pm    Post subject:
Reply with quote

It should not be a problem.
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Wed Jul 29, 2009 3:34 pm    Post subject:
Reply with quote

Thank you......
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Help in understanding what is th... mainakdalal PL/I & Assembler 9 Mon Oct 03, 2016 8:03 pm
No new posts Problem Compiling cobol code with Cob... amitc23 COBOL Programming 2 Wed Aug 24, 2016 1:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us