Mercurial > hg > orthanc
annotate OrthancFramework/Sources/SQLite/ITransaction.h @ 5765:247fc5368693 find-refactoring
un-sharing DatabaseConstraint and ISqlLookupFormatter with orthanc-databases
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Sep 2024 16:14:22 +0200 |
parents | f7adfb22e20e |
children |
rev | line source |
---|---|
1235 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * | |
3063 | 4 * Copyright (C) 2012-2016 Sebastien Jodogne <s.jodogne@orthanc-labs.com>, |
1235 | 5 * Medical Physics Department, CHU of Liege, Belgium |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
6 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
7 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
8 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1235 | 9 * |
10 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
11 * | |
12 * Redistribution and use in source and binary forms, with or without | |
13 * modification, are permitted provided that the following conditions are | |
14 * met: | |
15 * | |
16 * * Redistributions of source code must retain the above copyright | |
17 * notice, this list of conditions and the following disclaimer. | |
18 * * Redistributions in binary form must reproduce the above | |
19 * copyright notice, this list of conditions and the following disclaimer | |
20 * in the documentation and/or other materials provided with the | |
21 * distribution. | |
22 * * Neither the name of Google Inc., the name of the CHU of Liege, | |
23 * nor the names of its contributors may be used to endorse or promote | |
24 * products derived from this software without specific prior written | |
25 * permission. | |
26 * | |
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
38 **/ | |
39 | |
40 | |
41 #pragma once | |
42 | |
43 #include "NonCopyable.h" | |
44 | |
45 namespace Orthanc | |
46 { | |
47 namespace SQLite | |
48 { | |
49 class ITransaction : public NonCopyable | |
50 { | |
51 public: | |
52 virtual ~ITransaction() | |
53 { | |
54 } | |
55 | |
56 // Begins the transaction. This uses the default sqlite "deferred" transaction | |
57 // type, which means that the DB lock is lazily acquired the next time the | |
58 // database is accessed, not in the begin transaction command. | |
59 virtual void Begin() = 0; | |
60 | |
61 // Rolls back the transaction. This will happen automatically if you do | |
62 // nothing when the transaction goes out of scope. | |
63 virtual void Rollback() = 0; | |
64 | |
65 // Commits the transaction, returning true on success. | |
66 virtual void Commit() = 0; | |
67 }; | |
68 } | |
69 } |