Joined: 03 Oct 2008 Posts: 43 Location: Chennai,India.
After looking at this earlier thread, I come up with a doubt, which is as follows, please guide me:
If the version is to support multiple versions of the same package in a single system . Why not consistency token can be used to maintain the versions .
It is always that the version and consistency token going to be unique across packages . Could you please help me to understand why we are going for versions and not consistency token(CONTOKEN) .
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
You've replied to a 6-year old post. It's better to start a new thread with the reference to the old thread you've looked at. I'll split the thread to have new thread with your question, with subject line as : DB2 PLAN - version, consistency token - confusion? If you want to change it, please PM me.
Could you please help me to understand why we are going for versions and not consistency token(CONTOKEN) .
Suppose, you are working in a system where it supports multiple versions of packages. Like whenever, you go through the compilation process(precomp, compile, bind), and new package is created.
Scenario is,
1. Suppose you compile the program for the first time, you will get a load and package(V1), as one of the outputs.
2. you backup the load created by your first compilation to another PDS.
3. You again do a compilations, you will get a new load and package(V2).
4. You again do a compilations, you will get a new load and package(V3).
Now if you run the load that you took backup during the first compilation, it will use Package(V1) and not the package(v3).
Package and the load are related by consistency token.
Versions wont be like V1 or V2. Mostly, it will be a timestamp. Check SYSIBM.SYSPACKAGES table.
Why versions are used ?
Useful for testing & fallback.
Like you have your program, which is working perfectly now. Suddenly you get an idea to do some changes or you forgot to do some changes. You make the changes and now the program gives a different result, which you do not need.
Now all you have to do is to use the earlier load which you had backed up, to run the program.
And Ofcourse, you have to undo all the code changes you have done, that manual.
If you have a backup for that too, cool.
Joined: 03 Oct 2008 Posts: 43 Location: Chennai,India.
Sushanth ,
Thanks for you reply .
From your answer
"1. Suppose you compile the program for the first time, you will get a load and package(V1) and CONTOKEN (C1), as one of the outputs.
2. you backup the load created by your first compilation to another PDS.
3. You again do a compilations, you will get a new load and package(V2) CONTOKEN (C2).
4. You again do a compilations, you will get a new load and package(V3) and CONTOKEN (C3). "
Now my question is why do we need versions , if the consistency token itself being unique for different versions of programme. Since the CONTOKEN is differing every time we recompile , the CONTOKEN shall be used for maintaining versions.
Joined: 03 Oct 2008 Posts: 43 Location: Chennai,India.
Dick ,
I had gone through the provided link which was under the topic "Plans + DBRMS + Packages + Collections + Versions = Confusion" written by Bonnie Berker.
In the quarter 4 , it is given as below
" If the VERSION ID is the same as the current version, BIND will overlay the PACKAGE in its COLLECTION. But, if the VERSION ID is different from the current VERSION ID, BINDing the DBRM will produce a new PACKAGE that won't overlay the prior PACKAGE for the program"
But am confused with the CONTOKEN . If i am right the CONTOKEN will never be same for different VERSIONS of packages . So why do the new PACKAGE overlay the old one even if there was no concept of VERSIONS . Still the CONTOKEN can be used to differentiate the different versions of packages right.
if package versioning is not implemented, you will not get C2 & C3 there will be only C1 and whenever you go through the compilation process C1 will get replaced always.
Since versioning is implemented, you are able to differentiate like
for Version V1 , C1 is the contoken,
for Version V2 , C2 is the contoken........