OTL 4.0, OTL connect class

OTL connect class

This class encapsulates connect functions: connect, disconnect, commit, roll back, etc. In other words, the otl_connect class is the class for creating and handling connect objects together with transaction management.
class otl_connect{ 
public:
      int connected;
      static int otl_initialize(const int threaded_mode=0);
      static int otl_terminate(void);
  • OTL/OCI8, OTL/OCI9 only. Cancel any operation / database call, executing / active in the connect object / database session. Say, the database session is in the active state, or, in other words, has a running SQL statement in a thread. This function can be called from another thread, to cancel the execution of the SQL statement asynchronously. Right after the cancel() call returns, the first thread will raise an otl_exception with the following message: user requested cancel of current operation.
  •          void cancel(void);
  • Set transaction isolation level. OTL/DB2-CLI, OTL/ODBC only. The function allows the user to set the following levels: READ COMMITTED, READ UNCOMMITTED, REPEATABLE READ, SERIALIZABLE. For more detail on the transaction isolation levels, see the regular database manuls.
  •          void set_transaction_isolation_level(const long int level);
    OTL/ODBC and OTL/DB2-CLI define the following global constants, which can be used as substitutes for the level parameter of the function:
          void set_max_long_size(const int amax_size);
          int get_max_long_size(void);
          void set_cursor_type(const int acursor_type=0);
          void set_timeout(const int atimeout=0);
          otl_connect(const char* connect_str,const int auto_commit=0);
                   void rlogon(Lda_Def* lda);         void rlogon(HENV henv, // environment handle
                        HDBC hdbc, // database connect handle
                        const int auto_commit=0 // connect auto-commit mode
                       );
            otl_connect(HENV henv, // environment handle
                        HDBC hdbc, // database connect handle
                        const int auto_commit=0 // connect auto-commit mode
                       );
            void rlogon(OCIEnv* envhp, OCISvcCtx* svchp);
          void logoff(void);
         void server_attach(const char* tnsname=0); 
             // tnsname (TNS alias from TNSNAMES.ORA file) can be specified 
             // in order to connect to a remote Oracle 8 server. 
             // For local connections, tnsname gets defaulted to 0.
    
         void server_detach(void); // detach from the Oracle 8 server
         void session_begin(const char* username, // user name, e.g. "scott"
                               const char* password, // password, e.g. "tiger"
                               const int auto_commit=0 // session auto-commit mode
                              );
    
         void session_end(void);
          void session_reopen(const int aauto_commit=0 // session auto-commit mode
                                );
          void set_stream_pool_size
           (const int max_size=otl_max_default_pool_size);
    }; // end of otl_connect

    Prev NextContentsGo Home

    Copyright © 1996, 2001, Sergei Kuchin, email: skuchin@sprynet.com, kuchin@hotmail.com

    Permission to use, copy, modify and redistribute this document for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies. 1