ODBC Server Application Definition
The sample ErewhonInvestmentsODBC schema contains the OdbcServer application, which has initializeOdbcServer and finalizeOdbcServer as the
The parameters for this application are defined in the JADE initialization file using the following.
[JadeOdbcServer] ApplicationConfigFile=D:\jade\odbcconfig.xml
You can create and maintain the odbcconfig.xml file using the OdbcServerConfigurator application in the JadeMonitorSchema; for example:
jade.exe path=c:\jade\system ini=c:\jade\system\jade.ini schema=JadeMonitorSchema app=OdbcServerConfigurator
The sample configuration file contains the following.
<?xml version="1.0" ?> <jade_config> <application schema="ErewhonInvestmentsODBC" name="OdbcServer"> <odbc_config> <listen_host_name>localhost</listen_host_name> <listen_port_number>65434</listen_port_number> <listen_protocol_family>TcpIPv4</listen_protocol_family> <minimum_workers>2</minimum_workers> <maximum_workers>5</maximum_workers> <read_timeout>0</read_timeout> <queue_depth_limit>1</queue_depth_limit> <queue_depth_limit_timeout>2</queue_depth_limit_timeout> <worker_idle_timeout>120</worker_idle_timeout> </odbc_config> </application> </jade_config>
The defined host (localhost) and TCP/IP port number (65434) are used when defining the DSN for the ODBC thin client connection.
When the OdbcServer application is started and calls
In the sample, the initialization file specifies the XML file to be used. When the XML file is read, two worker processes are started (the minimum workers value) and these workers wait for connections on localhost::65434.
The worker processes also respond to management event call-backs from the multiple worker TCP/IP transport framework to start and stop workers, as required. If all of the workers are busy executing query requests, there will be no workers available to start new workers, if required. For this reason, we recommend that the minimum number of workers be set to one more than the queue depth limit.
In the sample, initially two workers are started. When a connection to a thin client is established, each request is queued and allocated to a worker process. If another connection is established and the requests overlap, the queue depth is exceeded, which sends a management request to start a new worker process. A third worker process is started and continues as long as the worker idle timeout is not exceeded. Up to five workers can be started (the maximum workers value).