Pages  [ 1  2  3  4 ]

An Introduction to mvServer 2.0:

VantagePoint Software has leveraged its founders' technical experience with MultiValued, PICK-based, systems by building a product to extend the useful life of PICK legacy code and data.

mvServer provides connection management, a highly efficient communication protocol, an SQL Server technology, and a robust native API which allows Windows, Linux, and Web-based client applications, to work with MultiValue (PICK) database systems on a client/server basis. With mvServer, you have a sophisticated SQL engine providing access to your legacy MultiValue (PICK) data down to the multi-value and sub-value level. It provides a mechanism which normalizes, on the fly, PICK data structures so client programs that only know normalized relational database formats can properly read and write PICK file items. mvServer also supports the definition and use of “stored procedures” taking advantage of the PICK/Basic procedural language available on all MultiValue database systems. These stored procedures, like any subroutine, can accept any number of arguments and generate a return set of data to the client process. There are a number of pre-defined stored procedures that are part of mvServer that can provide many standard data management functions.

mvServer optimizes access to your MultiValue data through a mapping process which identifies the accounts, files, and attributes you want to make available to client processes. SQL queries are parsed and preprocessed on the client side and passed down as query structures, which are easily converted to standard PICK processes for retrieving and updating data. mvServer even provides for complete transaction processing with support for BeginTrans, CommitTrans, or RollbackTrans operations at any point. Transaction processing is also supported when using stored procedures. For SQL processes there is also full support for bi-directional cursors resulting in efficient result set management.

mvServer supports a variety of communication protocols, providing a connection between your client applications and your MultiValue (PICK) host database system. mvServer supports serial connections, including dial-up access, and network protocols, including Novell SPX/IPX (through PicLan) and UNIX-based TCP/IP telnet connections.

The loading of mvServer, the mapping of your database system, and the full control of its operations can be done with simple client-based utilities from your PC workstations.

There are versions of mvServer that will work with jBASE, D3, mv.BASE, mv.Enterprise, UniVerse, Unidata, and other vendor specific implementations of the MultiValue (PICK) database system.

Server Definitions

Before a client program can communicate to a MultiValue (PICK) host system, a server definition must be constructed. A server definition is contained in a special MultiValue Server Definition object that is stored within a file with an .msd extension. These MSD object files can be placed anywhere, either on a client system or on a network server. While the MSD object is part of the dbObjects product, it is essential for allowing client applications to connect to and communicate with the server software of mvServer. You will need to define a MultiValue Server Definition (MSD) object for each of your MultiValue (PICK-based) host systems.

An MSD object will determine the type or method of connection, either a serial connection or a network connection, and any appropriate information to make the actual connection to a host database system. For each type of connection, a script must be defined as to how that connection will be made. The scripting, in essence,  is how the client will connect to the server software on the host system.

Connection scripts are a simple, text-based script language used to establish host database connections. The language is used to specify the communication port and parameters, as well as to log on to the host server. The script consists of statements, one per line, each beginning with a key word, or label followed by a keyword. A statement label is optional on any line and, if present, must be a unique integer number, followed by a colon (:) character. The keywords and their action are as follows:  

Keyword   Action
abort   The abort keyword terminates the connection script and returns an error to Vantage client program.  
break  

The break keyword sends a "break" signal to the server. The length of the break signal may be specified (if omitted, 100 milliseconds is used):

break {time}

where time is the number of milliseconds to send the break signal.  

clear   The clear keyword clears the received data buffer. All characters, which have been received, but not yet used, are discarded.  
send  

The send keyword is used to send a string to the server system. The syntax is:

send "text"

where text is the string to send. Control characters may be included in the string by "escaping" them with the backslash (\) character: \a for the bell control character, \b for backspace, \f for form feed, \n for line feed, \r for carriage return, \t for horizontal tab, \v for vertical tab and \e for escape.  Also, \x followed by two hex-decimal digits and \ followed by three octal digits may be used.

match  

The match keyword is used to search the received data from the host server system for a particular string. The syntax is:

match {time} "text"

where time is the number of milliseconds to wait for the match string to be received, and text is the match string.  If time is omitted, then the string must already be in the received data buffer. Control characters may be included in the match string by "escaping" them with the backslash (\) character as described for the send keyword.  If the match string is found within the specified time, the result is set to TRUE, and all received characters up to and including the match string are discarded.  Otherwise, the result is set to FALSE, and up to the last 1000 received characters are preserved for another match.

false  

The false keyword is used to test the result of a match and branch if FALSE. The syntax is:

false label

where label is a script statement label, which must be a unique integer number.

true

The true keyword is used to test the result of a match and branch if TRUE. The syntax is:

true label

where label is a script statement label, which must be a unique integer number.

goto

The goto keyword is used to branch unconditionally to a script statement label. The syntax is:

goto label

where label is a script statement label, which must be a unique integer number.

wait

The wait keyword is used to delay for a specified amount of time. The syntax is:

wait time

where time is the number of milliseconds to wait.

optimizeThe optimize keyword is used to invoke one of four telnet network protocol optimization techniques when making a connection and if used must be the first line of the script. The syntax is:

optimize number

where number is a value of 1, 2, 3, or 4 that identifies a specific optimization technique. The first three deal with pushing dummy packets as part of a telnet communication to avoid a built-in wait state that some systems incorporate during the packet acknowledgement process. Optimize 1 pushes a dummy packet from the server, Optimize 2 pushes a dummy packet from the client, Optimize 3 pushes a dummy packet in both directions. Optimize 4 is for known reliable telnet connections and avoids packet acknowledgement altogether for the fastest communication protocol.

Note: any time parameters, such as used in match or wait commands, are in milliseconds. The value is stored as an integer and so the largest amount of time entered is limited to 32767, or a little over 32 seconds. If you need to define more time, use additional wait commands. These wait commands can be used just before match commands to increase the total time before a match occurs.

The following is a sample host connection script with explanations:

optimize 4   Optimize telnet connection not to use packet acknowledgement for fastest protocol speed.
clear   discard any garbage in the buffer 
send "\r"   send a carriage return
match 5000 "Logon Please:" look for the Logon prompt
false 20   f not found, then branch to label 20  
10:   this is statement label 10.
send "MVSERVER\r"   send the string MVSERVER followed by return
match 5000 "}&    S\r"   look for the server response
false 30   if not found, then branch to label 30
exit   quit - successful connection!  
20:   this is statement label 20  
break 300send a "break" signal for 300 milliseconds
wait 250 wait for 250 milliseconds after the break  
clear   clear the input buffer (discard garbage)  
send "\x11OFF\r\r"   send a ctrl-q, OFF, and a carriage return
match 2500 "Logon Please:" look again for the Logon prompt  
true 10   if found, branch to label 10
30 abort Not able to connect   statement label 30 – abort with error message

Connect Debugging

During the installation of the Server Software of mvServer, or anytime a connection process does not appear to be functioning properly, you may use the Connection Debug Window as shown below:

Click image to expand

The debug window is useful for determining problems in initial Server Installation, Script debugging, or just problems which cannot be solved directly. It can provide the programmer a good behind the scenes look.

The information in the Debug Window may be saved to a file. There are options for saving the entire contents of the window, or just selected data, using the mouse, holding the left button down and highlighting the desired information. To save, click the File menu, select the Save option, then click the All or Selected menu option. At this point, the program will allow you to save the information in the desired directory and drive.

The information in the Debug Window may also be printed. This includes the entire contents of the window, or selected data. To print, click the File menu, select the Print option, and then click the All or Selected option.

Sever Configuration 

There is a configuration item CONFIG that is stored in the VSCONTROL file on the MVSERVER PICK account. It controls certain aspects of the communication process and server operations. Certain settings may be adjusted for use with particular Host systems and to tune performance. The following parameters are maintained in this item:

 

Parameter   Description  
Checksum   You may choose to use the Checksum option. This option will use the 16 Fletcher checksum protocol which will insure data integrity during communications between the client and server. This option is stored in line 1 of the CONFIG item. This is a Boolean property with valid values of 1 or 0.
Peeking  

If this option is set, the server program will use the Pick input buffer size and automatically read that much data in at a time. If the option is not set, the program will wait for a <return> to be entered from the client before continuing the process.  This option is stored in line 15 of the CONFIG item. This is a Boolean property with valid values of 1 or 0.

Optimize   You may choose to employ a optimized mode of operation which is a much faster protocol method, but one that does not insure data integrity. This option is stored in line 4 of the CONFIG item. This is a Boolean property with valid values of 1 or 0. If you use the optimize 4 option in your connection script you should set this attribute to true with a value of 1.  
Logging  

This option can be set if the programmer desires to know and record all of the communication between the client and server. A log will be kept in the VSLOGS file in the item LOG.NN (where NN is the Pick port number).

Every message sent to the server will be broken down into the different parts (i.e. Server Number, Table Name, User Name, etc.). Any responses from the server will also put into the record.

This option should be considered carefully! The Log item will grow rapidly. The larger the record, the slower the server will be in responding to requests from the client.

This option provides another level of debugging, in addition to the client side Debug Window. This option is stored in line 14 of the CONFIG item. This is a Boolean property with valid values of 1 or 0.

Input buffer size  

This should contain the maximum number of characters which may be typed in response to a BASIC INPUT statement before a carriage return is required. This is typically 140 on most PICK-based systems. You may want to adjust this value if your systems input buffer is larger or smaller. This option is stored in line 16 of the CONFIG item.

Time out  

This is the number of seconds to wait before "prompting" the client when receiving messages. This option is stored in line 17 of the CONFIG item.

Max Retries  

This is the number of attempts the server will make to send or receive a packet before failing. This option is stored in line 18 of the CONFIG item.

Server Security

The ADMIN User is currently the only user allowed when connecting through the mvServer Server program. Future releases will allow different users and groups of users to be entered and maintained with different levels of permissions. This "Administrator" (ADMIN) user will give all connections full read and write capabilities. For those using Stored Procedures to access data resources you can easily incorporate your own security scheme within your stored procedure code.

Database Mapping

After installing and setting up the mvServer Host software, Database Mapping is the next step in setting up your client software to run with your MultiValue (Pick) database.

All mapping definitions are maintained in the VSDATABASE file on your MVSERVER account. To map your system, you must first map the Databases (PICK Accounts) you want the client to have access to. To your client programs, each Pick Account is considered a separate Database available from your MultiValue host.

After the Databases (PICK Accounts) have been defined or mapped, the next step is to map the Tables (PICK Files) from within each of the defined Databases you want the client to have access to. The Table (PICK File) mapping process creates an entry in the VSDATABASE file and also creates a Q-pointer in the MD or VOC file of the MVSERVER account. This name of this Q-pointer is VSQ followed by a unique number assigned by the system. This generated "VSQ" name is also stored in the VSDATABASE Table item. The combination of the Table entry of the VSDATABASE file and the MD/VOC file Q-pointer is how the mvServer software can access any data file on the Host system.

Defining a record’s (PICK item’s) Fields (Attributes) within the Table is the next step. All fields, within a file, that will be accessed on an SQL basis must be first mapped. Only the Accounts and Files need mapping for Stored Procedure operations.

Since multivalues and sub-values are not a standard structure in most relational databases, the PICK programmer must normalize any multivalued fields. The way that mvServer allows you to do this is to create a Virtual Table. A Virtual Table physically does not exist. It must, however, be defined. A Virtual Table will be a subset of an existing defined Table (PICK File), known during the mapping process as a base table. A Virtual Table will contain a list of Fields (Attributes), either Multi-valued or Sub-valued, that are associated or correlated together.

For example: Contact Name, Contact Phone Number, and Contact Title are multi-valued fields within a Company Table (This is an example file on the MVSERVER Account). These three fields are associated and should be defined in a Virtual Table together. If the Company Table also has the multi-valued fields Pay Date and Pay Amount, these two fields should be defined in a different Virtual Table (but would be also a subset of the Company Table). There is no limit to the number of fields a Virtual Table may have, or the number of Virtual Tables an actual Table may have.

There is a full example of Virtual Table mapping in the MVSERVER account. The base table is the COMPANY file. The two virtual tables are the CONTACT and PHONE tables, which are pointers to embedded multi-valued data in the COMPANY table. There is also a sample client program, the CCP project (ccp.vbp), that is part of dbObjects which is programmed to work with these example files.

There are three different kinds of records within the VSDATABASE file: Database, Table, and Field records. Each will have a different key structure. The key to a database map item is simply the name of the Database (PICK Account name). The key to a Table map item is the Database (PICK Account) name concatenated to the Table (PICK File) name or Virtual Table name. The delimiter is the back slash character (\). The key to a Field map item is the Database (PICK Account) name concatenated to the Table (PICK File) name concatenated to the Field (PICK Dictionary Attribute Item) name. The delimiter is again the back slash character (\). As an example the key to the CITY field of the COMPANY table in the account APDEV is:

APDEV\COMPANY\CITY

Mapping items in the VSDATABASE file are defined as follows:

Attribute Position   Field Name Description  
1   Type   Type of Record: 1 = Database; 2 = Table; 3 = Field.  
2   Synonym  

For Table definitions, this is the Server Defined/Built q-pointer to the Database and Table. This q-pointer will be used in all client requests when referencing this table. The master dictionary or Voc file item will have a key of VSQnn (nn being a generated sequential number).  

3   User Names   The users that have permission codes for this type of record.
4   User Permissions

The associated permission codes for the user(s).

5   Group Names  

The groups that have permission codes for this type of record.

6   Group Permissions

The associated permission codes for the group(s).

7   Code  

Not used at this time.

8 Base Defined for Virtual Tables only, this is the name of the Table that this Virtual Table is a subset of. If this field has data in it, then this Table is a Virtual Table.
9   Virtual For a real/base table, this field will have all of the Virtual Tables Multi-valued that are associated to this base. If an entry exists in both the Base (8) and Virtual (9) for this record, this is a middle (a multi-valued Virtual file) which also has an associated Virtual sub-value file.  
10   Sub Value Base If this Virtual Table is a Subset of another Virtual Table (i.e. its Sub-Valued Virtual Table), the entry will represent the Real Table which this Virtual Table is a subset of.  
11 Base Virtual Field   For a field defined in an actual Table (file), this will list the Virtual Table(s) this field is in.  Since a field may only be defined with one Virtual Table, the information contained here will tell the client not to allow this field to be associated with any other Virtual Table. The only exception is when a Sub-Valued Virtual Table is defined. The fields within the sub-valued Virtual Table must also be defined in its base file (the multi-valued Virtual Table).  
12   Virtual Table Key Counter   Not used at this time.
13   Field Definition  

For each field mapped, the server compiles information for latter use with the client. There are 11 parts compiled (each part is delimited by a character 250. The parts are:

1 = Field Type (bit flags):

       Output conversion exist

       File Translation exist

4        Function exist

8        Concatenated field

16      Multi Valued/Multi Line

32      Key Field

64      Input Conversions exist

128     Modifiable Field

2 = Data Type

10      Text   

          7        Numeric

          5        Currency

          8        Time/Date

          12      Memo

3 = Field width

4 = Attribute Number

5 = Delimiter Position

6 = Max Position

7 = Delimiter Character

8 = Input Conversion Multi-valued

9 = Output Conversion Multi-valued

10 = Functions Multi-valued

11 = Translation Conversion Code  

There is a client-based mapping program that is part of the mvServer client software. This mvServer Database Mapping program (Vpmapm20.exe) is used to map Accounts (Databases), Files (Tables), Attributes (Fields), and Virtual Tables into the file VSDATABASE found in the MVSERVER Account. There is also a Host-based PICK/Basic program that can be used to map Files(Tables) into the VSDATABASE file. This cataloged program is VSMAPFILE and prompts you for the Database/Account name and File name to map. It will create the Table entry into the VSDATABASE file and create the appropriate "VSQ" pointer in the MD or VOC file.

 


 Next Page                                                                 Pages  [ 1  2  3  4 ]  

Back to mvComponents Suite 2.0 Overview

 


For additional information or to order a copy of mvComponents Suite 2.0 and arrange for a consultant, please send an E-mail to:

info@vpsoft.com

For VAR requirements and pricing please send E-mail to:

support@vpsoft.com