np_req_srv communicates with a CM and notify it of connections that are waiting for a response. This procedure is used internally by OpenSwitch and cannot be used by clients. See “Usage” for more information.
np_req_srv spid, username, appname, hostname, database, pool, rsn_code, rsn_text, cur_server, nxt_server
spid – the OpenSwitch process ID of the requesting connection.
username – the user name of the requesting connection.
appname – the application that established the requesting connection.
hostname – the client machine.
database – the current database context of the connection. If the server request is the result of a new login, this value is NULL.
pool – the pool name in which the connection is being established.
rsn_code – the reason code that describes why the request is blocked.
Value |
Description |
---|---|
1 |
The connection is logging in. cur_server is NULL, and nxt_server indicates the name of the remote server to use according to the pool in which the connection resides. |
2 |
A login retry. This code indicates that a previous attempt to log in to a server has failed, and that another server name is needed to retry. cur_server contains the name of the server that failed, and nxt_server contains the name of the server to use according to the pool in which the connection resides. |
3 |
Connection lost to remote server. This code indicates that a remote server unexpectedly dropped a connection and that the connection should be switched to the next available server. cur_server contains the name of the failed server, and nxt_server contains the name of the next available server within the pool in which the connection resides. |
4 |
Connection failed. This code indicates that a previous attempt to switch to the next available server failed. cur_server contains the name of the failed server, and nxt_server contains the name of the next available server in the pool in which the connection resides. |
rsn_text – text description of the rsn_code field.
cur_server – the name of the remote server currently being used by the connection, determined by the value of rsn_code.
nxt_server – the name of the remote server that the OpenSwitch has chosen for the connection based upon the pool in which the connection resides.
Example return values for np_req_srv are:
Parameter |
Example return value |
---|---|
spid |
|
username |
|
appname |
|
hostname |
|
database |
|
pool |
|
rsn_code |
|
rsn_text |
|
cur_server |
|
nxt_server |
|
np_req_srv is used to communicate with a coordination module to notify it of connections that are awaiting a response. This procedure is used by OpenSwitch internally to indicate that the connection is blocked and is awaiting a response from the coordination module, which can come in the form of a call to rp_set_srv, rp_switch, or rp_kill. Only these registered procedures or a disconnect from the client can wake up a connection waiting for a response.
np_req_srv is only issued if at least one coordination module is attached and the coordination mode is AVAIL, ALWAYS, or ENFORCED. For more information, see the OpenSwitch Coordination Module Reference Manual.
rp_kill, rp_set_srv, rp_switch
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |