XP Server

Extended stored procedures are implemented by an Open Server application called XP Server, which runs on the same machine as Adaptive Server. Adaptive Server and XP Server communicate through remote procedure calls (RPCs). Running ESPs in a separate process prevents Adaptive Server being affected by failures that may result from faulty ESP code. The advantage of using ESPs over RPCs is that the ESP runs in Adaptive Server the same way a stored procedure runs; you do not need to have Open Server to run the ESP.

XP Server is automatically installed with Adaptive Server. However, if you intend to develop XP Server libraries, you must purchase an Open Server license. Everything you need to use XP Server DLLs and run XP Server commands is included with your Adaptive Server license.

XP Server must be running for Adaptive Server to execute an ESP. Adaptive Server starts XP Server the first time an ESP is invoked and shuts down XP Server when Adaptive Server exits.

On Windows, if the start mail session configuration parameter is set to 1, XP Server automatically starts when Adaptive Server starts.

Using the CIS RPC mechanism

You can execute XP Server procedures using a CIS RPC mechanism, in addition to routing through the site handler. Set the options needed to use this mechanism, cis rpc handling and negotiated logins, by entering:

//to set 'cis rpc handling'//
sp_configure 'cis rpc handling', 1
//or at the session level//
set 'cis rpc handling' on
//to set 'negotiated logins'//
sp_serveroption XPServername, 'negotiated logins', true

If either option is not set, the ESP is routed through the site handler, and no warning message appears.

Using sybesp_dll_version

Sybase recommends that all libraries loaded into XP Server implement the function sybesp_dll_version. The function returns the Open Server API version used by the DLL. Enter:

CS_INT sybesp_dll_version()
----------
CS_CURRENT_VERSION

CS_CURRENT_VERSION is a macro defined in the Open Server API. Using this DLL prevents you from having to hard-code a specific value. If CS_CURRENT_VERSION is not implemented, XP Server does not attempt version matching, and prints error message 11554 in the log file. (For information on error messages, see the Troubleshooting and Error Messages Guide.) However, XP Server continues loading the DLL.

If there is a mismatch in versions, XP Server prints error message 11555 in the log file, but continues loading the DLL.

Manually starting XP Server

Normally, there is no reason for a user to start XP Server manually, since Adaptive Server starts it when it receives the first ESP request of the session. However, if you are creating and debugging your own ESPs, you may find it necessary to manually start XP Server from the command line using the xpserver utility. See the Utility Guide for the syntax of xpserver.