Mercurial > hg > orthanc
diff Core/SQLite/Transaction.h @ 1235:9b4977e3c19d
abstraction
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 05 Dec 2014 14:31:46 +0100 |
parents | 2255e66da726 |
children | 63d47b1fa239 |
line wrap: on
line diff
--- a/Core/SQLite/Transaction.h Fri Dec 05 11:11:58 2014 +0100 +++ b/Core/SQLite/Transaction.h Fri Dec 05 14:31:46 2014 +0100 @@ -38,12 +38,13 @@ #pragma once #include "Connection.h" +#include "ITransaction.h" namespace Orthanc { namespace SQLite { - class Transaction : public NonCopyable + class Transaction : public ITransaction { private: Connection& connection_; @@ -54,22 +55,17 @@ public: explicit Transaction(Connection& connection); - ~Transaction(); + + virtual ~Transaction(); // Returns true when there is a transaction that has been successfully begun. bool IsOpen() const { return isOpen_; } - // Begins the transaction. This uses the default sqlite "deferred" transaction - // type, which means that the DB lock is lazily acquired the next time the - // database is accessed, not in the begin transaction command. - void Begin(); + virtual void Begin(); - // Rolls back the transaction. This will happen automatically if you do - // nothing when the transaction goes out of scope. - void Rollback(); + virtual void Rollback(); - // Commits the transaction, returning true on success. - void Commit(); + virtual void Commit(); }; } }