digiKam
Digikam::BdEngineBackendPrivate Class Reference
+ Inheritance diagram for Digikam::BdEngineBackendPrivate:

Classes

class  AbstractUnlocker
 
class  AbstractWaitingUnlocker
 
class  BusyWaiter
 
class  ErrorLocker
 

Public Member Functions

 BdEngineBackendPrivate (BdEngineBackend *const backend)
 
bool checkOperationStatus ()
 
bool checkRetrySQLiteLockError (int retries)
 
void closeDatabaseForThread ()
 
void connectionErrorAbortQueries () override
 
void connectionErrorContinueQueries () override
 called by DbEngineErrorHandler, implementing DbEngineErrorAnswer More...
 
QString connectionName ()
 
QSqlDatabase createDatabaseConnection ()
 
QSqlError databaseErrorForThread ()
 
QSqlDatabase databaseForThread ()
 
void debugOutputFailedQuery (const QSqlQuery &query) const
 
void debugOutputFailedTransaction (const QSqlError &error) const
 
bool decrementTransactionCount ()
 
bool handleWithErrorHandler (const DbEngineSqlQuery *const query)
 Returns true if the query shall be retried. More...
 
bool incrementTransactionCount ()
 
void init (const QString &connectionName, DbEngineLocking *const locking)
 
bool isConnectionError (const DbEngineSqlQuery &query) const
 
bool isInMainThread () const
 
bool isInUIThread () const
 
bool isSQLiteLockError (const DbEngineSqlQuery &query) const
 
bool isSQLiteLockTransactionError (const QSqlError &lastError) const
 
bool needToConsultUserForError (const DbEngineSqlQuery &query) const
 
bool needToHandleWithErrorHandler (const DbEngineSqlQuery &query) const
 
void queryOperationWakeAll (BdEngineBackend::QueryOperationStatus status)
 
bool reconnectOnError () const
 
void setDatabaseErrorForThread (const QSqlError &lastError)
 
void setQueryOperationFlag (BdEngineBackend::QueryOperationStatus status)
 
virtual void transactionFinished ()
 
 ~BdEngineBackendPrivate () override
 

Public Attributes

QString backendName
 
QWaitCondition busyWaitCondVar
 
QMutex busyWaitMutex
 
int currentValidity
 
DbEngineErrorHandlererrorHandler
 
QWaitCondition errorLockCondVar
 
QMutex errorLockMutex
 
BdEngineBackend::QueryOperationStatus errorLockOperationStatus
 
bool isInTransaction
 
DbEngineLockinglock
 
BdEngineBackend::QueryOperationStatus operationStatus
 
DbEngineParameters parameters
 
BdEngineBackend *const q
 
BdEngineBackend::Status status
 
QThreadStorage< DbEngineThreadData * > threadDataStorage
 

Friends

class AbstractUnlocker
 

Constructor & Destructor Documentation

◆ BdEngineBackendPrivate()

Digikam::BdEngineBackendPrivate::BdEngineBackendPrivate ( BdEngineBackend *const  backend)
explicit

◆ ~BdEngineBackendPrivate()

Digikam::BdEngineBackendPrivate::~BdEngineBackendPrivate ( )
override

References threadDataStorage.

Member Function Documentation

◆ checkOperationStatus()

◆ checkRetrySQLiteLockError()

bool Digikam::BdEngineBackendPrivate::checkRetrySQLiteLockError ( int  retries)

◆ closeDatabaseForThread()

void Digikam::BdEngineBackendPrivate::closeDatabaseForThread ( )

References threadDataStorage.

Referenced by handleWithErrorHandler().

◆ connectionErrorAbortQueries()

void Digikam::BdEngineBackendPrivate::connectionErrorAbortQueries ( )
overridevirtual

◆ connectionErrorContinueQueries()

void Digikam::BdEngineBackendPrivate::connectionErrorContinueQueries ( )
overridevirtual

◆ connectionName()

QString Digikam::BdEngineBackendPrivate::connectionName ( )

References backendName.

Referenced by createDatabaseConnection().

◆ createDatabaseConnection()

◆ databaseErrorForThread()

QSqlError Digikam::BdEngineBackendPrivate::databaseErrorForThread ( )

References threadDataStorage.

◆ databaseForThread()

◆ debugOutputFailedQuery()

void Digikam::BdEngineBackendPrivate::debugOutputFailedQuery ( const QSqlQuery &  query) const

◆ debugOutputFailedTransaction()

void Digikam::BdEngineBackendPrivate::debugOutputFailedTransaction ( const QSqlError &  error) const

◆ decrementTransactionCount()

bool Digikam::BdEngineBackendPrivate::decrementTransactionCount ( )

References threadDataStorage.

◆ handleWithErrorHandler()

◆ incrementTransactionCount()

bool Digikam::BdEngineBackendPrivate::incrementTransactionCount ( )

References threadDataStorage.

◆ init()

void Digikam::BdEngineBackendPrivate::init ( const QString &  connectionName,
DbEngineLocking *const  locking 
)

◆ isConnectionError()

bool Digikam::BdEngineBackendPrivate::isConnectionError ( const DbEngineSqlQuery query) const

◆ isInMainThread()

bool Digikam::BdEngineBackendPrivate::isInMainThread ( ) const

◆ isInUIThread()

bool Digikam::BdEngineBackendPrivate::isInUIThread ( ) const

◆ isSQLiteLockError()

bool Digikam::BdEngineBackendPrivate::isSQLiteLockError ( const DbEngineSqlQuery query) const

◆ isSQLiteLockTransactionError()

bool Digikam::BdEngineBackendPrivate::isSQLiteLockTransactionError ( const QSqlError &  lastError) const

◆ needToConsultUserForError()

bool Digikam::BdEngineBackendPrivate::needToConsultUserForError ( const DbEngineSqlQuery query) const

◆ needToHandleWithErrorHandler()

bool Digikam::BdEngineBackendPrivate::needToHandleWithErrorHandler ( const DbEngineSqlQuery query) const

◆ queryOperationWakeAll()

void Digikam::BdEngineBackendPrivate::queryOperationWakeAll ( BdEngineBackend::QueryOperationStatus  status)

Set the wait flag to queryStatus and wake all waiting threads. Typically, call wakeAll with status ExecuteNormal or AbortQueries.

References errorLockCondVar, errorLockMutex, errorLockOperationStatus, operationStatus, and status.

Referenced by connectionErrorAbortQueries(), and connectionErrorContinueQueries().

◆ reconnectOnError()

bool Digikam::BdEngineBackendPrivate::reconnectOnError ( ) const

◆ setDatabaseErrorForThread()

void Digikam::BdEngineBackendPrivate::setDatabaseErrorForThread ( const QSqlError &  lastError)

References threadDataStorage.

◆ setQueryOperationFlag()

void Digikam::BdEngineBackendPrivate::setQueryOperationFlag ( BdEngineBackend::QueryOperationStatus  status)

Set the wait flag to queryStatus. Typically, call this with Wait.

References errorLockMutex, errorLockOperationStatus, operationStatus, and status.

Referenced by handleWithErrorHandler().

◆ transactionFinished()

void Digikam::BdEngineBackendPrivate::transactionFinished ( )
virtual

Friends And Related Function Documentation

◆ AbstractUnlocker

friend class AbstractUnlocker
friend

Member Data Documentation

◆ backendName

QString Digikam::BdEngineBackendPrivate::backendName

Referenced by connectionName(), and init().

◆ busyWaitCondVar

QWaitCondition Digikam::BdEngineBackendPrivate::busyWaitCondVar

Referenced by transactionFinished().

◆ busyWaitMutex

QMutex Digikam::BdEngineBackendPrivate::busyWaitMutex

◆ currentValidity

int Digikam::BdEngineBackendPrivate::currentValidity

This compares to DbEngineThreadData's valid. If currentValidity is increased and > valid, the db is marked as invalid

Referenced by databaseForThread().

◆ errorHandler

DbEngineErrorHandler* Digikam::BdEngineBackendPrivate::errorHandler

Referenced by handleWithErrorHandler().

◆ errorLockCondVar

QWaitCondition Digikam::BdEngineBackendPrivate::errorLockCondVar

Referenced by queryOperationWakeAll().

◆ errorLockMutex

QMutex Digikam::BdEngineBackendPrivate::errorLockMutex

◆ errorLockOperationStatus

BdEngineBackend::QueryOperationStatus Digikam::BdEngineBackendPrivate::errorLockOperationStatus

◆ isInTransaction

bool Digikam::BdEngineBackendPrivate::isInTransaction

◆ lock

◆ operationStatus

◆ parameters

◆ q

BdEngineBackend* const Digikam::BdEngineBackendPrivate::q

◆ status

BdEngineBackend::Status Digikam::BdEngineBackendPrivate::status

◆ threadDataStorage


The documentation for this class was generated from the following files: