Mercurial > hg > orthanc-databases
comparison Framework/MySQL/MySQLDatabase.h @ 23:b2ff1cd2907a
handling of implicit transactions in DatabaseManager
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 12 Jul 2018 10:44:17 +0200 |
parents | 1e9bad493475 |
children | 17f849b2af34 |
comparison
equal
deleted
inserted
replaced
22:1e9bad493475 | 23:b2ff1cd2907a |
---|---|
38 { | 38 { |
39 private: | 39 private: |
40 MySQLParameters parameters_; | 40 MySQLParameters parameters_; |
41 MYSQL *mysql_; | 41 MYSQL *mysql_; |
42 | 42 |
43 void OpenInternal(const char* database); | |
44 | |
43 void Close(); | 45 void Close(); |
44 | 46 |
45 public: | 47 public: |
46 MySQLDatabase(const MySQLParameters& parameters); | 48 MySQLDatabase(const MySQLParameters& parameters); |
47 | 49 |
55 void CheckErrorCode(int code); | 57 void CheckErrorCode(int code); |
56 | 58 |
57 MYSQL* GetObject(); | 59 MYSQL* GetObject(); |
58 | 60 |
59 void Open(); | 61 void Open(); |
62 | |
63 void OpenRoot() | |
64 { | |
65 OpenInternal(NULL); | |
66 } | |
67 | |
68 static void ClearDatabase(const MySQLParameters& parameters); | |
60 | 69 |
61 bool LookupGlobalStringVariable(std::string& value, | 70 bool LookupGlobalStringVariable(std::string& value, |
62 const std::string& variable); | 71 const std::string& variable); |
63 | 72 |
64 bool LookupGlobalIntegerVariable(int64_t& value, | 73 bool LookupGlobalIntegerVariable(int64_t& value, |
80 return Dialect_MySQL; | 89 return Dialect_MySQL; |
81 } | 90 } |
82 | 91 |
83 virtual IPrecompiledStatement* Compile(const Query& query); | 92 virtual IPrecompiledStatement* Compile(const Query& query); |
84 | 93 |
85 virtual ITransaction* CreateTransaction(); | 94 virtual ITransaction* CreateTransaction(bool isImplicit); |
86 | 95 |
87 static void GlobalFinalization(); | 96 static void GlobalFinalization(); |
88 }; | 97 }; |
89 } | 98 } |