SybContext class

index

# SybContext

SybContext implements CS_CONTEXT structure of SyBase Client Library.

### Class Method

create ( locname=nil, timeout=0, async=nil )
  Initialize Client-Library, and creates a SybContext object anew.

  Parameters:

  - locname
    A locale name which is registered in $SYBASE/locales/locales.dat

  - timeout
    The timeout value(seconds) for a server response.
    (the default is 0 , which represents an infinite timeout period.)

  - async
    The async parameter provides non blocking I/O.
    If the async parameter is true, then CS_DEFER_IO (deferred aynchromous I/O) will be used in netowork I/O.
    In case of multiple threads application, you must set this to true.

### Methods

destroy ( force=false )
  Exit a Client-Library.
  Returns TRUE if it was destroyed successfully
  (This method corresponds to ct_exit of Sybase Client Library.)

  If the force parameter is TRUE, then it closes all open connections for this context, whether or not any results are pending

setprop ( proptype, val )
  Sets Client-Library properties at the context structure levels.
  The proptype parameter must be a constant that is defined in SybConstant module.

  Returns TRUE if it was successful.

  (This method corresponds to ct_config(CS_SET) of Sybase Client Library.)

getprop ( proptype )
  Retrieves Client-Library properties at the context structure levels.
  The proptype parameter must be a constant that is defined in SybConstant module.

  (This method corresponds to ct_config(CS_GET) of Sybase Client Library.)