diff options
Diffstat (limited to 'odb/oracle/connection-factory.hxx')
-rw-r--r-- | odb/oracle/connection-factory.hxx | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/odb/oracle/connection-factory.hxx b/odb/oracle/connection-factory.hxx index aa8ed5b..67d18b1 100644 --- a/odb/oracle/connection-factory.hxx +++ b/odb/oracle/connection-factory.hxx @@ -25,42 +25,17 @@ namespace odb { namespace oracle { - class LIBODB_ORACLE_EXPORT connection_factory - { - public: - virtual connection_ptr - connect () = 0; - - public: - typedef oracle::database database_type; - - virtual void - database (database_type&) = 0; - - virtual - ~connection_factory (); - }; - class LIBODB_ORACLE_EXPORT new_connection_factory: public connection_factory { public: - new_connection_factory () - : db_ (0) - { - } + new_connection_factory () {} virtual connection_ptr connect (); - virtual void - database (database_type&); - private: new_connection_factory (const new_connection_factory&); new_connection_factory& operator= (const new_connection_factory&); - - private: - database_type* db_; }; class LIBODB_ORACLE_EXPORT connection_pool_factory: @@ -86,7 +61,6 @@ namespace odb min_ (min_connections), in_use_ (0), waiters_ (0), - db_ (0), cond_ (mutex_) { // max_connections == 0 means unlimited. @@ -111,8 +85,8 @@ namespace odb class LIBODB_ORACLE_EXPORT pooled_connection: public connection { public: - pooled_connection (database_type&); - pooled_connection (database_type&, OCISvcCtx*); + pooled_connection (connection_pool_factory&); + pooled_connection (connection_pool_factory&, OCISvcCtx*); private: static bool @@ -121,11 +95,7 @@ namespace odb private: friend class connection_pool_factory; - shared_base::refcount_callback callback_; - - // NULL pool value indicates that the connection is not in use. - // - connection_pool_factory* pool_; + shared_base::refcount_callback cb_; }; friend class pooled_connection; @@ -152,7 +122,6 @@ namespace odb std::size_t in_use_; // Number of connections currently in use. std::size_t waiters_; // Number of threads waiting for a connection. - database_type* db_; connections connections_; details::mutex mutex_; |