// file : odb/oracle/connection.hxx // author : Constantin Michael // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : ODB NCUEL; see accompanying LICENSE file #ifndef ODB_ORACLE_CONNECTION_HXX #define ODB_ORACLE_CONNECTION_HXX #include #include #include // std::auto_ptr #include #include #include #include #include #include #include #include #include #include namespace odb { namespace oracle { class statement; class statement_cache; class connection; typedef details::shared_ptr connection_ptr; class LIBODB_ORACLE_EXPORT connection: public odb::connection { public: typedef oracle::statement_cache statement_cache_type; typedef oracle::database database_type; virtual ~connection (); connection (database_type&); connection (database_type&, OCISvcCtx* handle); database_type& database () { return db_; } public: virtual transaction_impl* begin (); public: using odb::connection::execute; virtual unsigned long long execute (const char* statement, std::size_t length); public: OCISvcCtx* handle () { return handle_; } OCIError* error_handle () { return error_; } statement_cache_type& statement_cache () { return *statement_cache_; } details::buffer& lob_buffer () { return lob_buffer_; } private: connection (const connection&); connection& operator= (const connection&); private: database_type& db_; // It is important that the error_ member is declared before the // handle_ member as handle_ depends on error_ during destruction. // auto_handle error_; auto_handle handle_; std::auto_ptr statement_cache_; details::buffer lob_buffer_; }; } } #include #endif // ODB_ORACLE_CONNECTION_HXX