N2SVCD Configuration - DBApp
DB Application Configuration
The N2SVCD DB Application is a helper gateway application which performs asynchronous database requests. The default for Oracle SQL*Net DB requests is that the client will block and wait for the database lookup to complete. The N2SVCD DB Application spawns child processes which allow for long-running queries to be performed in the background, while allowing other tests and call processing to continue without interruption.
The following configuration is used to create a DB Application instance to perform asynchronous DB requests to a database server. A single DB Application instance will maintain a pool of connections to a single database server. If you need to connect to more than one remote database server, you must configure multiple DB Application instances (each with unique names).
In some cases, you may even wish to configure multiple DB Application instances to the same server. For example, you may wish to use one pool of DB connections for long-running queries, while creating a second pool for faster and more important queries.
<?xml version="1.0" encoding="utf-8"?> <n2svcd> ... <applications> ... <application name="DB-SMF" module="DBApp"> <include><lib>../apps/db/lib</lib></include> <parameters> <parameter name="connect" value="dbi:Oracle:host=10.42.2.154;sid=SMF;port=1521"/> <parameter name="username" value="smf"/> <parameter name="password" value="top-s3cr3t"/> <parameter name="pool" value="3"/> <parameter name="post_login_sql" value="BEGIN
SMF_SECURITY.RESPONSE(SMF.SMF_SECURITY_RESPONSE(SMF_SECURITY.CHALLENGE('N2 DB App'))); END;"/> ... ...
application element attributes for a DB Application instance are:
[Required] A unique name for this application instance.
[Required] Array of
value Parameters for this Application instance.
[Required] The DBI connection string for the target database.
When using DBD::Oracle with port 1521, it is strongly suggested that you explicitly specify the ";port=<port-num>" component of the connection string, to avoid a 60 second connection delay associated with a failed attempt to connect to port 1526.
Username to present to the database as credentials.
Password to present to the database as credentials.
Number of simultaneous child processes to maintain - one database connection per child.
(Default = 2).
Number of seconds to wait for a free connection before abandoning the request.
(Default = 10 seconds).
Number of seconds to wait on a submitted request before abandoning the request.
(Default = 20 seconds).
Time in seconds between attempts to re-connect a failed database connection.
(Default = 5 seconds).
Time in seconds between 'ping' to check connection on an inactive database connection.
(Default = 60 seconds).
Maximum length in bytes for reading LONG RAW columns. Applicable to Oracle DB only.
(Default = 65536).
An SQL command to perform via "do" after the DB connection is made.
(Default = None).
Note: The DBI connection string format varies according to the type of target database.
For an Oracle DB the format is is