3 #ifndef __locker_qsql_hpp
4 #define __locker_qsql_hpp
7 #include <hds_db/base/locker.hpp>
8 #include <hds_db/qsql/qsql_impl.hpp>
32 const std::string &name =
"hds_db_locker",
33 const size_t timeout = 1);
47 const std::string &name =
"hds_db_locker",
48 const size_t timeout = 1);
95 const size_t timeout);
108 unsigned int &locks_num)
const;
117 std::string m_mutex_name;
120 QSqlQuery m_client_connected_query;
123 QSqlQuery m_del_lock_by_cid_query;
126 QSqlQuery m_locks_list_query;
ErrCode init(const std::string &mutex_name, const size_t timeout)
virtual void list(LockDescriptionVec &locks)
ErrCode db_clear_invalid_locks()
virtual void release(const DbIndex &id)
Definition: dbcontext_qsql.hpp:15
uint64_t DbIndex
Definition: defines.hpp:26
Definition: locker.hpp:50
ErrCode
Definition: defines.hpp:46
virtual ErrCode lastError() const
LockType
Definition: locker.hpp:17
LockerQSql(const QSqlDatabase &db, const std::string &name="hds_db_locker", const size_t timeout=1)
ErrCode db_get_locks_num(const std::string &name, const LockType <, unsigned int &locks_num) const
std::vector< LockDescription > LockDescriptionVec
Definition: locker.hpp:47
virtual size_t releaseAll()
Definition: qsql_impl.hpp:19
virtual DbIndex lock(const LockDescription &ld)
Definition: locker.hpp:24
Definition: locker_qsql.hpp:17
ErrCode db_create_locks_table() const