Note: This topic is only relevant for applications with files deployed to a Windows database.
When developing an application with tables accessing a Windows database it is desirable to maintain the same schema name (library) through the lifecycle of the application to maintain the integrity of the database and table data. While this sounds obvious it can be problematic if not planned appropriately.
The fundamental issue relates back to RDML source version control and how various releases of the application source code are maintained, built and released.
By default LANSA files are defined and compiled in the Default File Library of the current Partition. If the application source code is moved to a different Partition or a different LANSA system, where the partition's Default File Library is also different, the next time the file is compiled and deployed the library (schema name) will, by default, be different.
How to assign a consistent schema
1. BEFORE deploying the first version of the application, select a schema name (library) to be used for the installed Windows application e.g. XXXDTA.
2. BEFORE deploying the first version of the application, modify the application source code to include appropriate DEFINE_OVERRIDE_FILE commands to redirect the file OAMs to the appropriate LANSA Library (schema name).
If all file OAMs should be redirected to the selected schema XXXDTA, the code added may look something like this:
Use Builtin(Define_Override_File) (*PARTDTALIB *Default 'XXXDTA') To_Get(#retcode)
3. Create the first Version of the application to be deployed including the files to be created in the Windows database. Ensure the selected files are configured to install into schema name XXXDTA by creating a library substitution for this value and assigning it to the files.
4. When creating subsequent Versions and Patches ensure the same library substitution value is assigned to the selected files.
For more information refer to Lifecycle of an Application and Mapping a File's Library to a Fixed Deployed Schema.