51 m_Connected(connected), m_Database(db),
52 m_DBWrapper(db_wrapper),
54 m_StopSignal(0, 10000000)
90 }
catch (
const exception & ex) {
91 ERR_POST(
"Unexpected exception in the DB restore "
92 "connection thread Main() function: " << ex <<
93 " Ignore and continue.");
95 ERR_POST(
"Unexpected unknown exception in the DB restore "
96 "connection thread Main() function. Ignore and continue.");
122 LOG_POST(
Note <<
"Database connection has been restored");
124 }
catch (
const exception & ex) {
125 ERR_POST(
"Exception while restoring DB connection: " << ex <<
126 " Ignore and continue.");
128 ERR_POST(
"Unknown exception while restoring DB connection. "
129 "Ignore and continue.");
159 "has been decrypted");
162 }
catch (
const exception & ex) {
163 ERR_POST(
"Exception while decrypting database password: " << ex <<
164 " Ignore and continue.");
166 ERR_POST(
"Unknown exception while decrypting database password. "
167 "Ignore and continue.");
Database connection object.
void Close(void)
Close database object.
void Connect(void)
Explicitly (re)connect to the database server.
CAtomicCounter_WithAutoInit m_StopFlag
virtual void * Main(void)
Derived (user-created) class must provide a real thread function.
void x_RestoreConnection(void)
~CNSTDBConnectionThread()
CNSTDatabase * m_DBWrapper
CNSTDBConnectionThread(bool &connected, CDatabase *&db, CNSTDatabase *db_wrapper, CFastMutex &db_lock)
void x_CreateDatabase(void)
void x_CreateDatabase(bool is_initialization)
static CNSTPreciseTime Current(void)
static void Reload(void)
Re-read key file locations and domain paths, reload encryption keys.
TValue Add(int delta) THROWS_NONE
Atomically add value (=delta), and return new counter value.
TValue Get(void) const THROWS_NONE
Get atomic counter value.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void Lock(void)
Acquire mutex for the current thread with no nesting checks.
void Wait(void)
Wait on semaphore.
static void SetCurrentThreadName(const CTempString &)
Set name for the current thread.
bool TryWait(unsigned int timeout_sec=0, unsigned int timeout_nsec=0)
Timed wait.
void Post(unsigned int count=1)
Increment the semaphore by "count".
void Unlock(void)
Release mutex with no owner or nesting checks.
where both of them are integers Note
static const CNSTPreciseTime gs_MinRetryToConnectTimeout(1.0)
static const CNSTPreciseTime gs_MinRetryToCreateTimeout(100.0)
Defines NCBI C++ secure resources API.