Welcome Guest | My Membership | Login

Tech Tip: Accounts, Namespaces, and Databases in Caché

Article

If you are migrating from another MultiValue system to Caché, an introduction to some key terminology differences would be useful.

Like all MultiValue systems, Caché understands the concept of an ACCOUNT. Each ACCOUNT contains a VOC or MD (the terms are used interchangeably). Users can be configured to automatically LOGTO an ACCOUNT when they login, and with permission, LOGTO other accounts. When they LOGTO an ACCOUNT, an optional user or LOGIN script can run.

Except in a few cases where traditional OS files are used, Caché stores most data, such as MultiValue FILEs, in OS files named cache.dat. These are referred to as databases, and can hold multiple FILEs. Databases automatically expand as needed and very efficiently store data in optimized B-trees.

Users typically access multiple databases simultaneously. For example, Caché ships with a database that contains our system code, another that contains the documentation, and a third for temporary data that may need to be written to disk. Developers typically store their code in one database and user data in another, or a few.

When you first import a MultiValue account into Caché, all data and code for the ACCOUNT are stored in one database (cache.dat). Separating your code and data into distinct databases is highly recommended and will make installation and upgrade of production applications easier. A Namespace is the Caché term for a collection of databases under one name. Using multiple databases this way achieves the same result as Q-pointers without having different ACCOUNTS. Please note that Q-pointers are supported as well. From a MultiValue perspective, a Namespace and an ACCOUNT are synonymous.

Since all database files are named cache.dat, they are distinguished by the folder they live in. The root folder for each Caché installation includes a folder named Mgr that contains our system code. Caché's root folder also contains a configuration file named cache.cpf. Among other things, this file defines where the system and user databases are stored.

Caché has always had a concept similar to MultiValue ACCOUNTs to help developers organize their programs and data. A cache.cpf file can define multiple Namespaces, each defining the system and user databases it references. Namespaces are a logical concept defined in the cache.cpf file.

So each MultiValue ACCOUNT is specified as a Caché Namespace that specifies all the databases for that ACCOUNT. MultiValue applications typically reference multiple ACCOUNTS. This is supported in Caché via Q-pointers and the Caché concept called mapping which can reference code and data from another Namespace/ACCOUNT.

Just as MultiValue users at The Command Line prompt are in an ACCOUNT, Caché users at a Terminal prompt are in a Namespace. When a Caché user types the command "MV" at a Terminal prompt, the MultiValue shell is started in that Namespace.

So for Caché, an ACCOUNT corresponds to a Namespace. The CREATE.ACCOUNT command has added an extra parameter indicating where to create the cache.dat file.

Do you have a Tech Tip to share? E-mail it to editor@intl-spectrum.com

 

# # #          # # #          # # #

 

Related Articles

  • Convert C#/VB.NET Date/Time to Internal Date

    This Article will show you how to convert a C# or VB.NET Date/Time object into an Internal MultiValue Date. It will show you how to do it using the ICONV functions, and well as how to generate an Internal Date without using the ICONV function.

  • Convert Internal Date into C#/VB.NET Date/Time

    This article will show how to convert a MultiValue (PICK) Internal Date into a DateTime object that you can use in C# and VB.NET. The article will cover how use the OCONV statement, as well as, how to generate the DateTime object without using the OCONV statement.

  • Numeric to Alpha Translation

    Database: D3, Advanced Pick, AREV, jBase, Mentor/PRO, mv*Base, mvEnterpise, OpenInsight, OpenQM, Reality, Ultimate, UniVerse, UniData, UniVision

    The attached subroutine will convert a numeric values to their alphabetic values. The number "4" converts to "four"; "25" converts to twenty five, etc. There is also an option that will allow you to change a numeric value into an alphabetic count. For example, 4 converts to "forth", "25" converts to twenty-fifth.


Return to top