Mapping a Global
Mapping a Global
When you map a global to database ABC, you configure a given namespace so that Caché writes this global to and reads this global from the database ABC, which is not the default database for your namespace. When you define this global mapping, Caché does not move the global (if it already exists) to the designated database; instead the mapping instructs Caché where to read and write the global in the future.
To map a global:
If the global already exists, move it to the desired database. See “Moving Data from One Database to Another,” later in this chapter.
Access the Management Portal.
Select System Administration > Configuration > System Configurations > Namespaces.
Select Global Mappings in the row for the namespace in which you want to define this mapping.
Select New Global Mapping.
For Global database location, select the database that should store this global.
Enter the Global name (omitting the initial caret from the name). You can use the * character to choose multiple globals.
The global does not have to exist when you map it (that is, it can be the name of a global you plan to create).Note:
Typically you create mappings for data globals for persistent classes, because you want to store that data in non-default databases. Often you can guess the name of the data globals, but remember that Caché automatically uses a hashed form of the class name if the name is too long. It is worthwhile to check the storage definitions for those classes to make sure you have the exact names of the globals that they use. See “Storage,” earlier in this book.
To save the mappings, select Save Changes.
For more information, see the Caché System Administration Guide.
You can also define global mappings programmatically; see the “Globals” entry in the InterSystems Programming Tools Index.
The following shows an example global mapping, as seen in the Management Portal, which does not display the initial caret of global names:
This mapping means the following:
Within the namespace DEMONAMESPACE, if you set values of nodes of the global ^MyTempGlobal, you are writing data to the CACHETEMP database.
This is true whether you set the nodes directly or indirectly (via object access or SQL).
Within the namespace DEMONAMESPACE, if you retrieve values from the global ^MyTempGlobal, you are reading data from the CACHETEMP database.
This is true whether you retrieve the values nodes directly or indirectly (via object access or SQL).