Ora8SessionEnd Function

Action

Terminates a user session context which has been started with Ora8SessionBegin.

Include file

Ora8.bdh

Syntax

Ora8SessionEnd( in hSvcCtx  : number,
                in hSession : number,
                in nMode    : number optional ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hSvcCtx The service context handle.
hSession The session handle which should be de-authenticated.
nMode

Specifies the various modes of operation (optional).

The only valid mode is OCI_DEFAULT.

Omit the parameter in order to use the default parameter.

Example

var
  ghEnv0        : number;
  ghError0      : number;
  ghServer0     : number;
  ghSvcCtx0     : number;
  ghSession0    : number;

dcltrans
  transaction TMain
  begin
    Ora8Init(ghEnv0);
    Ora8HandleAlloc(ghEnv0, ghError0, OCI_HTYPE_ERROR);
    Ora8HandleAlloc(ghEnv0, ghServer0, OCI_HTYPE_SERVER);
    Ora8HandleAlloc(ghEnv0, ghSvcCtx0, OCI_HTYPE_SVCCTX);
    Ora8ServerAttach(ghServer0, "ORCLNET2");
    Ora8AttrSetHandle(ghSvcCtx0, OCI_HTYPE_SVCCTX, ghServer0, OCI_ATTR_SERVER);
    Ora8HandleAlloc(ghEnv0, ghSession0, OCI_HTYPE_SESSION);
    Ora8AttrSetString(ghSession0, OCI_HTYPE_SESSION, "SCOTT", OCI_ATTR_USERNAME);
    Ora8AttrSetString(ghSession0, OCI_HTYPE_SESSION, "TIGER", OCI_ATTR_PASSWORD);
    Ora8SessionBegin(ghSvcCtx0, ghSession0, OCI_CRED_RDBMS);
    Ora8AttrSetHandle(ghSvcCtx0, OCI_HTYPE_SVCCTX, ghSession0, OCI_ATTR_SESSION);

    ...

    Ora8SessionEnd(ghSvcCtx0, ghSession0);
    Ora8HandleFree(ghSession0, OCI_HTYPE_SESSION);
    Ora8ServerDetach(ghServer0);
    Ora8HandleFree(ghSvcCtx0, OCI_HTYPE_SVCCTX);
    Ora8HandleFree(ghServer0, OCI_HTYPE_SERVER);
    Ora8HandleFree(ghError0, OCI_HTYPE_ERROR);
    Ora8HandleFree(ghEnv0, OCI_HTYPE_ENV);
  end TMain;

See Also

Oracle's Programmer's Guide to Oracle Call Interface for Wrapped Oracle function: OCISessionEnd