Live Connection manages database and Java application connections to
improve performance for Net.Data on the Windows NT, OS/2, AIX, and Sun
Solaris operating systems. Through the use of a Connection Manager and
cliettes, processes that maintain open connections, Live Connection eliminates
the start up overhead of connecting to a database or starting a Java Virtual
Machine.
Live Connection uses a configuration file, dtwcm.cnf, to
determine what cliettes need to be started. It contains administration
information and definitions for each of the cliettes used with Live
Connection. See Managing Connections to learn more about Live Connection.
The sample configuration file shown in Figure 6 contains the following types of information:
- Connection Manager port information
- SQL cliette information for a DB2 connection
- Java application cliette information
Figure 6. The Live Connection configuration file
1 CONNECTION_MANAGER{
2 MAIN_PORT=7100
3 }
4
5 CLIETTE DTW_SQL:CELDIAL{
6 MIN_PROCESS=1
7 MAX_PROCESS=5
8 EXEC_NAME=./dtwcdb2
9 DATABASE=CELDIAL
10 LOGIN=marshall
11 PASSWORD=stlpwd
12 }
13
14 CLIETTE DTW_JAVAPPS{
15 MIN_PROCESS=1
16 MAX_PROCESS=5
17 EXEC_NAME=./javaapp
18 }
|
- Lines 1 - 3 are required for the configuration file and define unique port
numbers used with Live Connection.
- Lines 5 - 12 define all database cliettes, identifying the cliette name,
the number of processes to be run, database name,, and the cliette exec
file. You can include additional information, such as a user ID and
password for connecting to a DB2 database.
- Lines 14 - 18 define all cliettes for Java applications, identifying the
cliette name, the number of processes to be run, unique port numbers, and the
cliette exec file.
|
|
Before you begin: Read the hints and tips section
following these steps before customizing the Live Connection configuration
file.
Configuring Live Connection ports:
The value you choose for MAIN_PORT is the port number that will be used
first. The port numbers that live connection could use can be
calculated using the setting of MAIN_PORT and each cliette's
MAX_PROCESSES. When loaded, live connection allocates ports starting at
the number specified in MAIN_PORT and incrementally until the cumulative
MIN_PROCESSES are reached. As needed, it will then load ports until the
MAX_PROCESSES are reached. The maximum number of ports used are the sum
of the MAX_PROCESSES settings.
For example, in the configuration in Figure 6, the port numbers allocated would be 7100, 7101, and 7102,
and then up to 7110 as needed.
Important:
- Check with your system administrator to ensure that the port numbers you
plan to use are available.
- Ensure that the value of MAIN_PORT matches the value of DTW_CM_PORT in the
Net.Data initialization file.
Configuring database cliettes:
- Type the cliette environment statement.
CLIETTE type:db_name
Parameters:
- type
- The name that associates a language environment with a cliette. See
*** for a list of valid types.
- db_name
- The database cliette name, which is often the same as the database with
which the cliette is associated, such as MYDBASE; however the
db_name can also be another name.
db_name is optional when using the Oracle language environment.
- Determine values for MIN_PROCESS and MAX_PROCESS. MIN_PROCESS
specifies the number of processes to be started when the Connection Manager is
started. Afterwards, if additional simultaneous requests arrive, the
Connection Manager starts more cliettes, adding one as needed, until the value
specified for MAX_PROCESS is reached.
Type the MIN_PROCESS and MAX_PROCESS statements:
MIN_PROCESS=min_num
MAX_PROCESS=max_num
Parameters:
- min_num
- The number of cliette processes to be started when the Connection Manager
is started. You must have enough available unique port numbers for this
number of cliettes.
- max_num
- The maximum number of cliettes that can be run simultaneously. You
must have enough available unique port numbers for this number of
cliettes.
- Specify the name of the cliette executable file. This file name is
specified as:
EXEC_NAME=./dtwcdbtypeid
Where dbtypeid is the database type identifier. Refer to Table 6 for valid executable file names:
Table 6. Cliette exec file names
Cliette Description
| Cliette Type
| Names
| Platform Availability
|
UNIX
| Windows NT or OS/2
| AIX
| NT
| OS/2
| HP
| SUN
| PTX
|
---|
DB2 process cliette
| DTW_SQL
| dtwcdb2
| dtwcdb2.exe
| Y
| Y
| Y
| Y
| Y
| N
|
ODBC process cliette
| DTW_ODBC
| dtwcodbc
| dtwcodbc.exe
| Y
| Y
| N
| N
| N
| N
|
Oracle process cliette
| DTW_ORA
| dtwcora
| dtwcora.exe
| Y
| Y
| N
| N
| N
| N
|
- Specify the name of the database with which the cliette is
associated:
DATABASE=db_name
Where db_name is the name of the database with which the cliette
is associated; for example, MYDBASE.
- Optional: Change the default values for the LOGIN and PASSWORD
variables to *USE_DEFAULT so that Net.Data uses the same user ID that
started the Connection Manager to connect to the DB2 database. By
specifying these default values, you avoid placing this information in the
configuration file. For example, replace lines 14 and 15, in the sample
configuration file in Figure 6 with these lines:
LOGIN=*USE_DEFAULT
PASSWORD=*USE_DEFAULT
Tip: If you define multiple cliette entries in the
configuration file, you can specify various database login and passwords for a
particular database.
Configuring Java application cliettes:
- Type the cliette environment statement:
CLIETTE DTW_JAVAPPS
- Determine values for MIN_PROCESS and MAX_PROCESS. MIN_PROCESS
specifies the number of processes that are to be started when the Connection
Manager is started. Afterwards, if simultaneous requests arrive, the
Connection Manager starts more cliettes, adding one as needed, until the value
specified for MAX_PROCESS is reached.
Type the MIN_PROCESS and MAX_PROCESS statements.
MIN_PROCESS=min_num
MAX_PROCESS=max_num
Parameters:
- min_num
- The number of cliette processes started when the Connection Manager is
started. You must have enough available unique port numbers for this
number of cliettes.
- max_num
- The maximum number of additional cliettes that can be run
simultaneously. You must have enough available unique port numbers for
this number of cliettes.
Hints and tips for configuring Live Connection:
- Cliette names are used by the Connection Manager to uniquely identify a
set of cliettes.
- For database cliettes, you must have one named set of cliettes for each
database you plan to access. For databases that are rarely accessed,
you can set the MIN and MAX number of cliettes to 1. Alternatively, you
can also set MIN to 0, which means processes are not started until a
Net.Data request is made for the cliette.
- The NAME of the cliette must be consistent with the cliette name
referenced in the ENVIRONMENT statement for the cliette type in initialization
file. The cliette name can contain variables, and in the case of
database cliettes, it should include the variable reference
$(DATABASE). The default value for the cliette name in the ENVIRONMENT
statement is DTW_SQL:$(DATABASE). You can use a variable
reference in the initialization file, but not the Live Connection
configuration file.
The DATABASE variable is defined in the Net.Data macro. When
an SQL statement in the macro is encountered, the $(DATABASE) variable
reference in the Net.Data initialization file is replaced with the
current value of DATABASE.
You can use this method to access multiple databases. If you have
three databases that you wanted to access in your Net.Data macro (for
example, D1, D2, and D3), and your initialization file has the standard
CLIETTE "DTW_SQL:$(DATABASE)" line, then you need three sections in the
live connection configuration file such as:
CLIETTE DTW_SQL:D1{ ...}
CLIETTE DTW_SQL:D2{....}
CLIETTE DTW_SQL:D3{....}
- Processes are started but not stopped. If you set the maximum
number of processes to M and at any time M processes are used simultaneously,
they stay active until you shut down the Connection Manager, therefore you do
not want the value of MAX_PROCESS to be so high that you use up all of your
system resources starting processes that are rarely used.
Recommendation: Try using different values for MIN_PROCESS
and MAX_PROCESS to see what works best for your system. If the
Connection Manager receives more requests than the specified maximum value,
the last request is queued until a cliette finishes processing. When a
cliette becomes available, the queued request is then processed. This
process of queuing requests is transparent to the application
user.
- You can use the same type of cliette for different named sections.
For example, all DB2 database sections of the configuration file use the same
cliette type. You cannot have two sections with the same name.
If you are using CGI, and want only some databases to use Live Connection,
simply list the databases you want in the configuration file. When
Net.Data is processing a Net.Data macro and encounters an SQL
function, it asks the Connection Manager for a specific cliette. If the
Connection Manager does not have that type of cliette, it responds with a
NO_CLIETTE_AVAIL message. Net.Data processes the request with a
DLL version instead.
Confiring the Connection Manager service to start
automatically:
On Windows NT, you can specify to have Connection Manager start as an
Windows NT service, instead of from the command line. Running
Connection Manager as an Windows NT service allows Connection Manager to be
automatically started each time the machine is started.
Important: Start Connection Manager from the command line
before setting it up to start automatically to ensure that the Live Connection
configuration file is correct.
- From the Windows NT task bar, select Start->Settings->Control Panel
->Services.
- Select Net.Data Connection Manager, then click the
Startup button.
- Select Automatic startup type, then click on
OK.
[ Top of Page | Previous Page | Next Page | Index ]