25 #ifndef DIGIKAM_DB_ENGINE_BACKEND_PRIVATE_H
26 #define DIGIKAM_DB_ENGINE_BACKEND_PRIVATE_H
33 #include <QSqlDatabase>
35 #include <QThreadStorage>
36 #include <QWaitCondition>
73 void init(
const QString& connectionName,
DbEngineLocking*
const locking);
75 QString connectionName();
77 QSqlDatabase databaseForThread();
78 QSqlError databaseErrorForThread();
79 void setDatabaseErrorForThread(
const QSqlError& lastError);
81 QSqlDatabase createDatabaseConnection();
82 void closeDatabaseForThread();
83 bool incrementTransactionCount();
84 bool decrementTransactionCount();
86 bool isInMainThread()
const;
87 bool isInUIThread()
const;
89 bool reconnectOnError()
const;
91 bool isSQLiteLockTransactionError(
const QSqlError& lastError)
const;
95 void debugOutputFailedQuery(
const QSqlQuery& query)
const;
96 void debugOutputFailedTransaction(
const QSqlError& error)
const;
98 bool checkRetrySQLiteLockError(
int retries);
99 bool checkOperationStatus();
105 void connectionErrorContinueQueries()
override;
106 void connectionErrorAbortQueries()
override;
108 virtual void transactionFinished();
150 void finishAcquire();
168 QWaitCondition*
const condVar);
171 bool wait(
unsigned long time = ULONG_MAX);
Definition: dbenginebackend_p.h:144
BdEngineBackendPrivate *const d
Definition: dbenginebackend_p.h:155
int count
Definition: dbenginebackend_p.h:154
Definition: dbenginebackend_p.h:163
QWaitCondition *const condVar
Definition: dbenginebackend_p.h:176
QMutex *const mutex
Definition: dbenginebackend_p.h:175
Definition: dbenginebackend_p.h:192
Definition: dbenginebackend_p.h:182
Definition: dbenginebackend_p.h:67
QString backendName
Definition: dbenginebackend_p.h:122
DbEngineParameters parameters
Definition: dbenginebackend_p.h:124
BdEngineBackend *const q
Definition: dbenginebackend_p.h:200
int currentValidity
Definition: dbenginebackend_p.h:118
bool isInTransaction
Definition: dbenginebackend_p.h:120
QWaitCondition busyWaitCondVar
Definition: dbenginebackend_p.h:137
QMutex errorLockMutex
Definition: dbenginebackend_p.h:132
QThreadStorage< DbEngineThreadData * > threadDataStorage
Definition: dbenginebackend_p.h:112
BdEngineBackend::Status status
Definition: dbenginebackend_p.h:126
BdEngineBackend::QueryOperationStatus operationStatus
Definition: dbenginebackend_p.h:130
QMutex busyWaitMutex
Definition: dbenginebackend_p.h:136
DbEngineLocking * lock
Definition: dbenginebackend_p.h:128
DbEngineErrorHandler * errorHandler
Definition: dbenginebackend_p.h:139
QWaitCondition errorLockCondVar
Definition: dbenginebackend_p.h:133
BdEngineBackend::QueryOperationStatus errorLockOperationStatus
Definition: dbenginebackend_p.h:134
Definition: dbenginebackend.h:66
Status
Definition: dbenginebackend.h:90
QueryOperationStatus
Definition: dbenginebackend.h:114
Definition: dbengineerrorhandler.h:42
Definition: dbengineerrorhandler.h:60
Definition: dbenginebackend.h:52
Definition: dbengineparameters.h:49
Definition: dbenginesqlquery.h:41
Definition: dbenginebackend_p.h:48
int transactionCount
Definition: dbenginebackend_p.h:60
QSqlError lastError
Definition: dbenginebackend_p.h:61
QSqlDatabase database
Definition: dbenginebackend_p.h:58
int valid
Definition: dbenginebackend_p.h:59
Definition: datefolderview.cpp:43