allow specify how many times we can try to connect to the database
This commit is contained in:
@@ -104,17 +104,23 @@ public:
|
||||
virtual void set_conn_param(const std::wstring & database_host, const std::wstring & database_hostaddr, const std::wstring & database_port,
|
||||
const std::wstring & database, const std::wstring & user, const std::wstring & pass);
|
||||
|
||||
|
||||
virtual void set_conn_param(const std::wstring & database, const std::wstring & user, const std::wstring & pass);
|
||||
|
||||
virtual void connect();
|
||||
virtual void wait_for_connection();
|
||||
virtual void close();
|
||||
//virtual bool assert_connection(bool put_log = true, bool throw_if_no_connection = true);
|
||||
virtual bool assert_connection(bool put_log = true);
|
||||
virtual void set_db_parameters();
|
||||
virtual void log_connection_socket();
|
||||
|
||||
/*
|
||||
* waiting for a valid connection to the database
|
||||
*
|
||||
* attempts_max - how many connection attempts are allowed (0 - infinite)
|
||||
* attempt_delay - delay between each attempt (in seconds)
|
||||
*
|
||||
*/
|
||||
virtual bool wait_for_connection(size_t attempts_max = 0, size_t attempt_delay = 5);
|
||||
|
||||
|
||||
/*
|
||||
* close the connection with the database if it was open
|
||||
*/
|
||||
virtual void close();
|
||||
|
||||
|
||||
|
||||
@@ -132,6 +138,12 @@ protected:
|
||||
std::wstring db_user;
|
||||
std::wstring db_pass;
|
||||
|
||||
virtual void set_db_parameters();
|
||||
virtual void log_no_connection(size_t attempts);
|
||||
virtual void log_connection_socket();
|
||||
virtual bool assert_connection_is_working(bool put_log = true);
|
||||
virtual void connect();
|
||||
|
||||
virtual bool do_query(const char * query_str, PostgreSQLQueryResult * psql_result);
|
||||
virtual void allocate_default_expression();
|
||||
virtual void overwrite(pt::TextStream & stream);
|
||||
|
Reference in New Issue
Block a user