|
|
What is MEDIATOR for
SQL Anywhere?
|
Mediator is a software package allowing to execute any
CA-Clipper application on the Sybase Adaptive Server Anywhere (ASA) database. The
look-and-feel of application is not changed. Data used by the application is stored in the
ASA database.
|
What elements does
MEDIATOR consist of?
|
MEDIATOR consists of two main parts. The first one is a set
of MEDIATOR libraries linked to CA-Clipper application. The second one is MEDIATOR server
acting as middleware between CA-Clipper applications and Sybase Adaptive Server Anywhere.
In CA-Clipper application MEDNTX driver can be used, conforming to DBFNTX, or MECDX driver
which conforms to DBFCDX.
|
How does
CA-Clipper/MEDIATOR application work?
|
CA-Clipper/MEDIATOR application is sending requests to
MEDIATOR server instead of operating on DBF files. The server communicates with ASA
database and returns answers to the application. CA-Clipper/MEDIATOR application follows a
client-server model: data processing (selection, sorting, indexing) is located on the
server, while data presentation is located on workstations.
|
What does CA-Clipper
application gain by using MEDIATOR?
|
The most important advantages are:
- working upon large sets of data stored in ASA database
- secure data and indexes
- access to ASA database features (transactions, SQL, stored
procedures)
- low costs of porting and implementing
- possibility of gradual migration to other programming
environments
|
Which network
protocols are supported by MEDIATOR?
|
CA-Clipper/Mediator applications can can communicate with
Mediator server using TCP/IP or IPX/SPX network protocols. The environments allowing to
execute applications are:
- DOS and NetWare client: NETX, VLM or 32-bit (IPX/SPX).
- DOS with 32-bit NetWare client for DOS (TCP/IP)
- Windows 95/98/ME/NT/2000/XP (IPX/SPX, TCP/IP)
|
Is it possible to use
SQL in CA-Clipper/MEDIATOR applications?
|
Yes. It is possible to use SQL queries (USE AS and SELECT
instruction) or any other SQL instructions (MedExecSQL). Access to query results is
organized just like access to regular data. MedExecSQL function allows to execute any
command (with exception of SELECT).
|
To what degree does
MEDIATOR conform to DBFNTX/DBFCDX standard?
|
Mediator conforms to DBFNTX/DBFCDX as much as possible for
the sake of quick porting applications. That is why expression indexes are implemented as
well as the vast majority of CA-Clipper instructions(for example: APPEND, CREATE, FLOCK,
FOUND, GO, PACK, RECNO, RLOCK, SEEK, SET INDEX, UNLOCK, USE, ZAP). Instructions operating
on files are NOT implemented, because they may be used for manipulation with either DBF or
NTX objects or files of other types. These are: FILE, FOPEN, FCLOSE, FRENAME, FERASE,
FREAD, FWRITE. These functions are working in a default way in Mediator, i.e. they are
operating on physical files. For manipulation with objects stored in ASA database use
functions and commands delivered by Mediator. In particular, the following functions
should be replaced when accessing objects exported to RDBMS:
FILE() -> MedIsTable(), MedIsIdx(), MedIsBag()
DELETE FILE, ERASE -> DROP INDEX, DROP TABLE, MedDropIdx(), MedDropTab()
ADIR -> MedGetTabs(), MedGetIdxs()
RENAME -> MedRenTab()
Indexes from NEXT, WHILE, FOR and EVAL clause are not
implemented. SORT instruction is not implemented.
|
How does Mediator
implement operations typical for CA-Clipper such as deleting of records, record
numbers and expression indexes?
|
In tables manipulated by MEDNTX/MECDX the record numbers,
deleting of records and expression indexes are implemented through the additional columns
added to tables. A record number is implemented by creating a non-empty numerical RECNO
column, and values stored there are assigned by Mediator server. Deleting of records is
implemented by creating non-empty IS_DELETED char column where a deleted record stores Y
and a not deleted record stores N. Each expression index is implemented in an additional
column in the source table. The complete operation of this column is Mediator's duty.
|
How are locks
implemented in Mediator?
|
In tables manipulated with MEDNTX and MECDX drivers, FLOCK,
RLOCK and DBRLOCK locks are implemented by Mediator server and by Sybase ASA. If a lock
has been made during the transaction, then a locked object is not accessible for
modification by other processes (not serviced by Mediator) until the transaction
completion. If a lock has been made outside the transaction, then it is visible only by
CA-Clipper/Mediator applications. The lock will NOT be visible for other applications.
|
Is it possible to
make applications created with other tools to work on data manipulated by MEDIATOR?
|
If CA-Clipper/Mediator application uses MEDNTX/MECDX driver
(the one compatible with DBFNTX/DBFCDX), then easiness of cooperation depends on the type
of application created with other tools. If the other application reads data only, then no
modification is necessary. If non-Mediator application has to modify data as well, two
conditions have to be satisfied:
- All modifications executed in CA-Clipper/Mediator application
have to be located in the transaction(for reasons described in the previous question).
- Non-Mediator application has to service organizational
Mediator columns, that is RECNO, IS_DELETED and expression indexes. It should also
implement undefined values (NULL) like Mediator (refer to documentation).
|
What CA-Clipper
compilers and linkers does Mediator cooperate with?
|
Mediator can cooperate with CA-Clipper 5.2e and 5.3
compilers(5.3a, 5.3b). To link an application, you need Blinker, version 4.0 or later.
Demo version of Blinker is available from www.blinkinc.com.
|
How to prepare
CA-Clipper application for using it with Mediator? How much time can it take?
|
Steps necessary for application porting:
- moving data and indexes to Sybase ASA using Mediator utilities
- adding Mediator header file to *.PRG files with the directive:
#include "mediator.ch"
- adding the following command to one of files of a ported
program:
request medntx
- changing the data source (by using
RDDSETDEFAULT("MEDNTX") or RDDSETDEFAULT("MEDCDX") instruction or by
VIA "MEDNTX"/"MEDCDX" specification in each USE command)
- replacing functions operating on files with corresponding
Mediator functions:
FILE() -> MedIsTable(), MedIsIdx(), MedIsBag()
DELETE FILE, ERASE -> DROP INDEX, DROP TABLE, MedDropIdx(), MedDropTab()
ADIR -> MedGetTabs(), MedGetIdxs()
RENAME -> MedRenTab()
Actions listed above are obligatory if the ported application
is to work on Sybase ASA. Time of porting depends on the size of application. For an
average application it should not be longer than 2 days. It is possible to make further
modifications for the sake of improving the performance, such as introducing transactions
and SQL queries, and the like. For detailed instructions refer to documentation.
|
Is it possible to use
MEDNTX, MEDCDX drivers and *.DBF files simultaneously?
|
Of course. In the same applications some tables can be opened
with MEDNTX driver, other tables with MECDX driver and the rest can be opened as usual DBF
files using standard DBFNTX or DBFCDX driver. In each workarea application can open the
table using different data driver.
Typical problems associated with
CA-Clipper/MEDIATOR programs and respective solutions
|
The application is
unable to connect with MEDIATOR server. The following message is displayed: Unable to
connect to the server. Bad address?
|
Check whether DOS environment variables which specify the
address for connection, are set (MEDNETADDR, MEDNODEADDR, MEDSOCKET). If IPX/SPX protocol
is used, check the frame compatibility on server and client machines. If TCP/IP protocol
is used, check whether server is reachable (ping instruction is useful).
Check versions of all Mediator libraries - use only these
that are delivered in a package.
WARNING! On Windows 98 you can use only IPX/SPX protocol.
TCP/IP is not implemented yet.
|
While linking the
application with Mediator libraries I receive an error: undefined symbols
|
Check whether you are using CA-Clipper compiler version 5.2e
or 5.3x. If so, check whether you are linking all MEDIATOR libraries (example linking
scripts are delivered in MEDIATOR package).
|
CA-Clipper/MEDIATOR
application executed on the computer with installed Windows NT operating system is unable
to connect to server.
|
Check whether OMVDD.DLL file is installed on computer with
Windows NT, and if it is available in the system path. If not, install it in
WINNT\SYSTEM32 directory.
|
|