|
|
What is MEDIATOR for
Oracle?
|
Mediator is a software package allowing to execute any
CA-Clipper application on the Oracle database. The look-and-feel of application is not
changed. Data used by the application is stored in the Oracle 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 Oracle server. In CA-Clipper
application MEDNTX/MEDCDX driver can be used, conforming to DBFNTX/DBFCDX, or MEDSQL
driver which conforms to SQL applications.
|
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 Oracle
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 on large sets of data stored in Oracle database
- secure data and indexes
- access to Oracle database features (transactions, SQL, PL/SQL)
- 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 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 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 Oracle 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 with NEXT, WHILE, FOR and EVAL clause are not
implemented. SORT command is not implemented.
|
How does Mediator
implement operations typical for CA-Clipper such as the deleting of records, record
numbers and expression indexes?
|
In tables manipulated by
"MEDNTX"/"MEDCDX" 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. The 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.
In tables manipulated with "MEDSQL" driver record
numbers (RECNO) are not used. RECNO() function returns a unique record ID, determined by
the programmer while opening the table. If ID is not determined, RECNO() function returns
Oracle database row ID (ROWID). DELETE function deletes record from the table (it is not
possible to undelete with the use of RECALL). Indexes are implemented by Oracle database -
no feature supporting expression indexes is provided. However, it is possible to use
composite indexes (i.e. indexes pertaining several columns).
|
How are locks
implemented in Mediator?
|
In tables manipulated with "MEDNTX" and
"MEDCDX" drivers, FLOCK, RLOCK and DBRLOCK locks are implemented by Mediator
server and by Oracle database. 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.
In tables manipulated by "MEDSQL" driver, FLOCK,
RLOCK and DBRLOCK locks are implemented by using Oracle database functions only. This is
the reason why CA-Clipper/Mediator applications, which operate upon data modified by other
applications, should use "MEDSQL" driver.
|
Is it possible to
make applications created with other tools to work on data manipulated by MEDIATOR?
|
If CA-Clipper/Mediator application uses MEDSQL driver only
then it constitutes a text interface to Oracle database and its cooperation with other
applications is problem free.
If CA-Clipper/Mediator application uses MEDNTX or MEDCDX
driver as well (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 additional 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 Oracle 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
Oracle database 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 Oracle server. 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 MEDSQL driver simultaneously?
|
Of course. In the same applications some tables can be opened
with MEDNTX or MEDCDX driver, and other tables with MEDSQL driver. The recommended method
of migration of CA-Clipper application to SQL tools (for example Oracle Developer 2000,
Power Builder and others) is a quick porting application using MEDNTX or MEDCDX driver and
then gradual modification of the application that the tables operated upon by SQL
applications would be opened by MEDSQL driver.
|
Is it possible to use
Oracle tables and *.DBF files simultaneously?
|
Yes. In the same application some tables can be opened via
MEDNTX driver, others via MEDCDX 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.
|
|