by Craig Shearer >> Mon, 17 Jan 2000 19:40:38 GMT
Hello All
Just a cautionary tale to relate in upgrading a deployed system from JADE 4.2.2 to JADE 5.
You need to be very careful upgrading. We have a deployed JADE 4 system that has been in production for some time now. As usual, it has been patched many times, adding new functionality, fixing bugs etc. and as with most deployed systems, the deployed and development systems get "out of sync" in terms of class numbering - class numbers in the deployed system are different from those in the development system for one reason or another.
When upgrading a deployed database from JADE 4 to JADE 5, you need to have the development system extract that EXACTLY matches the deployed system in terms of its class numbers and also the class structure (ie all the class's properties).
We had a sticky situation where we used the JADE 5 upgrade to upgrade our deployed JADE 4 system to version 5 and it appeared to work, even though the structure was different. At least the message that came back was that the upgrade was successful. Not until the users started using the system did we find some rather puzzling errors, such as Exception 4 - Object Not Found, and Exception 1010 - The requested method is not defined for the type of the receiver. It would seem that the upgrade does not detect changes in the class structure, and consequently won't mark classes for reorg. This causes 3039 exceptions.
The solution was as follows:
1. Get the development environment in sync with the deployment environment. For us, this meant finding all the class numbers for classes in our deployed database. We wrote a simple method to do this:
getClasses();
vars
cls : Class;
f : File;begin
create f transient;
f.openOutput("c:\classes.txt");
foreach cls in currentSchema.getAllClasses(false) where cls.schema = currentSchema do
f.writeLine(cls.name & Tab & cls.number.String);
endforeach;
epilog
delete f;
end;
This produced a file which I then loaded into an Excel Spreadsheet. I ran the same code on the development version, and loaded its output into the spreadsheet, side by side so they could be compared.
2. Identify all the classes where the class numbers are different in the development environment.
3. Do a full schema extract from your development environment.
4. Load up your .scm file in a text editor, and under the typeHeaders section, fix up all the class numbers so that they reflect the deployed environment. Save your .scm file.
5. Now, delete all your schemas from your development copy (make sure you've got a backup first!). Unfortunately, you're going to lose all your test data!
6. Reload the edited schemas. Note no changes are necessary to your .ddb file unless you happen to have a control class with a different class number. Luckily we didn't, but if you did - you'd need to fix up the .ddb file too (scary!)
7. You should now have the development and deployed environments in synch. You can upgrade your development environment to JADE 5 then use the multiple schema extract to upgrade the deployment database too.
Finally, just another point, once this is completed, you could then load in a new version of the schema, even if it has differing class numbers as the normal schema load handles this. This is what we had in our situation where we'd already upgraded our development environment to JADE 5 and had started making changes.
Hope this helps...
Craig.