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