IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using UR in the code


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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: 193
Location: chennai

PostPosted: Mon Jul 27, 2009 10:42 pm
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
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
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top