Obtains a bind token so an extended stored procedure session can share a common transaction lock space with the client session that invoked the extended stored procedure, instead of opening a separate session.
int srv_getbindtoken (
char* bindtoken );
Is a pointer to the SRV_PROC structure that is the handle for a particular client connection. The srvproc parameter contains information that the ODS Library uses to manage communication and data between the application and client.
Is a pointer to a buffer where the bind token will be copied. The bind token is represented as a null-terminated string. The buffer you specify should be 255 bytes in length.
SUCCEED or FAIL.
To bind an extended stored procedure session to the client session that called it so they share the same transaction lock space
- The extended stored procedure calls svr_getbindtoken. This uses the existing bind token of the client session if the session is already bound. If not, srv_getbindtoken creates a new bind token and binds the client session to the token. srv_getbindtoken then returns the bind token in the bindtoken parameter.
- The extended stored procedure uses the bind token with sp_bindsession to bind an extended stored procedure session to the client session. Multiple extended stored procedure sessions can be bound to a client session.
- A bound session is unbound when the external stored procedure returns or when sp_bindsession is called with an empty string.
Note Only one bound session at a time can have access to a shared connection. If one session is currently executing a statement at the server or has results pending from the server, no other sessions sharing the same bound connection can gain access to the server until the current session has finished executing the current statement. If a session attempts to gain access to the connection while the server is busy, an error is returned to the conflicting session indicating the connection is in use and the session should retry later.