company logo

Dictionary :: open - Open dictionary handle

The function allows opening a dictionary handle. When the dictionary handle is already opened, it will be closed before being opened again.

A dictionary can be opened in local or file server mode, or in server mode (object or replication server). Local mode usually implies exclusive access. When running several applications on a local machine the dictionary should be opened in file server mode in order to provide concurrent access to the dictionary. Server mode is suggested when running the dictionary from different clients on a central server.

Implementation details

  1. Open dictionary handle copy
    Dictionary  :: open ( odaba::Dictionary &cDictionary )

    This function creates a copy of the dictionary handle passed in cDictionary. Both, the copy and the origin are referring to the same dictionary access object. The dictionary handle is closed when closing the last dictionary handle referring to the same access object, regardless on the sequence dictionary handles have been opened.

    If cDictionary is not opened the function does not throw an exception and the calling dictionary is closed, too.

    • cDictionary - Dictionary handle

      The dictionary handle usually refers to an opened dictionary. Calling functions with invalid dictionary handles may cause an exception. For checking the dictionary handle, isValid() can be called.

  2. to list
  3. Open dictionary handle
    Dictionary  :: open ( odaba::String &sFilePath, odaba::AccessModes eAccessMode, bool bShared )

    The function creates a dictionary handle referring to the main client of the application. In order to open a dictionary on an object server, the main client has to be connected to the server before opening the dictionary.

    The dictionary path (sFilePath) passed to the function contains the database location (local or file server) or an option name (server). Local file paths may contain option names that are resolved before opening the dictionary.

    The dictionary storage type is determined from the file name extension. Usually, ODABA is used as storage type.

    The dictionary can be opened in read or write mode (eAccessMode). When running the dictionary in file server mode, bShared defines whether the dictionary is running exclusive or can be shared with other users. In order to share the dictionary, true should be passed.

    • sFilePath - Complete file path
    • eAccessMode - Access mode

      Access mode for a property handle or database.

    • bShared - Shared database access

      Passing true indicates that multi-user access is requested. False indicates exclusive use of database. Accessing a database in update or write mode, false guarantees absolute exclusive access.

  4. to list
  5. Open dictionary handle for new dictionary object
    Dictionary  :: open ( odaba::Client &cClient, odaba::String &sFilePath, odaba::StorageTypes eStorageType, odaba::ResourceTypes eResourceType, odaba::AccessModes eAccessMode, bool bShared, bool bEnableContext )

    The function creates a dictionary handle for a client handle passed in rClient. In order to open a dictionary on an object server, the client handle has to be connected to the server before opening the dictionary.

    The dictionary path (sFilePath) passed to the function contains the database location (local or file server) or an option name (server). Local file paths may contain option names that are resolved before opening the dictionary.

    The dictionary storage type passed in eStorageType defines the type of data store for the dictionary data. When passing UndefinedStorage, the storage type is determined from the file name extension. Usually, ODABA is used as storage type. The eResourceType parameter defines the way the dictionary is opened, i.e. locally or in client/server mode.

    The dictionary can be opened in read or write mode (eAccessMode). When running the dictionary in file server mode, bShared defines whether the dictionary is running exclusive or can be shared with other users. In order to share the dictionary, true should be passed.

    Usually, business rules (context classes) are enabled for the dictionary. In order to disable business rules, false has to be passed in bEnableContext. When disabling business rules, the dictionary has to be closed and reopened in order to activate business rules again.

    Notes:

    In order to read an older version of the dictionary, you may call ObjectSpace::setVerion() .

    • cClient - Client handle

      The client handle refers to an (usually) opened ODABA client. Calling functions with invalid client handles may cause an exception. For checking the client handle, isValid() can be called.

    • sFilePath - Complete file path
    • eStorageType - Database storage type

      The database storage type defines the type of database used for storing data. Usually, the storage type is ODABA.

    • eResourceType - Resource type

      Depending on the resource type the database or dictionary is opened on the client or server side.

    • eAccessMode - Access mode

      Access mode for a property handle or database.

    • bShared - Shared database access

      Passing true indicates that multi-user access is requested. False indicates exclusive use of database. Accessing a database in update or write mode, false guarantees absolute exclusive access.

    • bEnableContext - Disable context

      When passing false for this option, this indicates that the application is running as system application. In this case context functions are disabled and will not be executed. This option should never be set in normal applications because this may lead to logical inconsistency of the database.

      When passing true, the option value is read from the current settings for the ENABLE_CONTEXT system option.


  6. to list
  7. Open dictionary by path
    Dictionary  :: open ( odaba::String &sFilePath )

    The function creates a dictionary handle referring to the main client of the application. In order to open a dictionary on an object server, the main client has to be connected to the server before opening the dictionary.

    The dictionary path (sFilePath) passed to the function contains the database location (local or file server) or an option name (server). Local file paths may contain option names that are resolved before opening the dictionary.

    The dictionary storage type is determined from the file name extension. Usually, ODABA is used as storage type.

    The dictionary is opened in read and as shared dictionary.

    • sFilePath - Complete file path
  8. to list