![]() |
|||
|
Database Operation Services Database operation services are provided by a generic Database Object Server (VPDb20.dll) and a specific MultiValue Database Object server (VPMvdb20.dll). The specific MultiValue Database Object server is a simpler object to work with and is used as a “wrapper” object that contains and uses the generic Database Object server to accomplish its tasks. More will be given on this MultiValue Database Object Server later. Connection Management Objects
In addition to these two Database objects
is a Gateway Server connection management object server that works behind the scenes
and actually manages the connection to MultiValue (Pick) Database systems.
This Gateway Server object can support local client-to-server connections
or work remotely over a network providing connections through a Windows
2000 or NT central server system. Used either on a local basis or
remotely on a central gateway server system, the Gateway Server object
(VPGwsv20.exe) can provide multithreaded, multiplexing connections to a
MultiValue host database system. This out-of-process object server provides a special Server object with a single Request method that handles all protocol requests to the
MultiValue (PICK) host system and the return of any responses. The Server
object works in conjunction with a Channel object (VPChnl20.exe) that
sends any requests through the
MultiValue Connection (VPMv20.dll) Dynamic Link Library that has a set of exported functions that handle the actual communication process.
The Gateway Server can be automatically instantiated by a client process
or can be started as a Windows service with pre-configured cached connections
to a host system. Using the Windows Service version of the Gateway
software is important for fast scaleable operations. This is especially
important for multiplexing remote client connections, supporting web
service connections, or Web applications. Database Objects
The generic Database Object Server (VPDb20.dll) is available as an in-process dynamic link library. The highest-level object supplied by this component is the Database Session object (DbSession). This object holds a collection of Database objects (Databases). Each Database object (Database) holds a collection of Query objects (Queries). Both the Database object (Database) and the Query object (Query) contain a collection of Result objects (Results). A Result object (Result) can be generated for a Database object (Database) through the execution of a stored procedure. A Result object (Result) can also be generated from the execution of a query defined within a Query object (Query). When the Database or Query Object performs an operation with the Vantage mvServer Protocol it uses a Request object that is part of the Database component.
The Database Session object (DbSession) is the one object that a programmer directly creates in code. All other objects such as Databases, Queries or Results are created through methods of objects higher up within the hierarchy of objects. Below is a figure that shows the relationships between the different objects that comprise the Database Object Server:
The figure above shows that the main Database object uses the VDD and MSD objects and that each Result object provides its data in the form of DynamicArray objects. This figure also shows that the Request object is routing its calls to the
connection management out-of-process Gateway Server object
(VPGwsv20.exe).
A majority of the properties for the Database object are supplied by the Attach method. The Attach method links a Database object with a supplied reference to a Virtual Database Definition (VDD) object. This VDD object provides the Database object the information it needs to connect to a database source and provides references to all the exposed tables and fields for that “attached” source. It also identifies to the Database object the type of application programming interface (API) and primary object support to use when working with that database source. If the source database is a MultiValue
(PICK) Database then the VDD object also has the reference to the MultiValue Server Definition (MSD) object and the information stored in this object is also made available to the Database object. Once a VDD object has been “attached”, the Database object can be used to create and manipulate queries, handle transaction processing, and execute stored procedures.
Each Database object holds a collection of Query objects (Queries). Each Query object (Query) of the collection is used to construct a dynamic SQL command statement or query. The SQL query can operate as a Select query, producing updateable record sets or non-updateable “snapshot” record sets. The result set from a Query object is returned as a Result object (Result) that is part of the Results collection (Results) for a query object. Any fetched data from the result set is returned as a multi-dimensional dynamic array object (DynamicArray). An SQL command statement of a Query object can also act as an Action query for direct updates to an attached database source.
Each Database object is where a transaction context can be set for the later operations of the child Query objects. A Database object also has the ExecuteProc method for executing stored procedures associated with a database source. The ExecuteProc method has two parameters: “Name”, the name of the store procedure to execute, and “Parameters”, a string parameter to hold any arguments that need to be passed to the called stored procedure. The results returned by the stored procedure, if any, are placed into the return value of the function-type method.
The following is a very simple example set of code that uses both a VDD object and the Database object from dbObjects to read a set of customer records and load them into a grid control within a Visual Basic program. While this example is strictly a 2-tier approach and not how you would design a distributed application, it does showcase, in a simple way, the code required to instantiate and use these objects. This code example also uses the DynamicArray object of Power Strings to manipulate the data before it is placed into a Grid control. The figure below is what the program looks like followed by the code associated with the Visual Basic project:
For additional information or to order a copy of mvComponents Suite
2.0 and arrange for a consultant, please send an E-mail to: For VAR requirements and pricing please send E-mail to:
|
|||