summaryrefslogtreecommitdiff
path: root/slice/Freeze/Connection.ice
blob: ac024a71bd7b2ac7036868b898619bd6b4dff41b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// **********************************************************************
//
// Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#pragma once

#include <Freeze/Transaction.ice>
#include <Ice/Version.ice>
#include <Ice/CommunicatorF.ice>

[["cpp:header-ext:h", "objc:header-dir:objc"]]

module Freeze
{

/**
 *
 * An attempt was made to start a transaction
 * while a previous transaction has not yet been
 * committed or rolled back.
 *
 **/
local exception TransactionAlreadyInProgressException
{
};


/**
 * 
 * A connection to a database (database environment with Berkeley
 * DB). If you want to use a connection concurrently 
 * in multiple threads, you need to serialize access to this
 * connection.
 *
 **/
local interface Connection
{
    /**
     *
     * Create a new transaction. Only one transaction at a time can
     * be associated with a connection. 
     *
     * @return The new transaction.
     *
     * @throws TransactionAlreadyInProgressException Raised if a 
     * transaction is already associated with this connection.
     *
     **/
    Transaction beginTransaction();
    
    
    /**
     *
     * Returns the transaction associated with this connection. 
     *
     * @return The current transaction if there is one, null otherwise.
     *
     **/
    ["cpp:const"] Transaction currentTransaction();


    /**
     *
     * Remove an old unused Freeze Map index
     * @throws IndexNotFoundException Raised if this index
     * does not exist
     *
     **/
    void removeMapIndex(string mapName, string indexName);

     
    /**
     *
     * Closes this connection. If there is an associated transaction,
     * it is rolled back.
     *
     **/
    void close();

    
    /**
     *
     * Returns the communicator associated with this connection.
     *
     **/
    ["cpp:const"] Ice::Communicator getCommunicator();

    /**
     *
     * Returns the encoding version used to encode the data.
     *
     **/
    ["cpp:const"] Ice::EncodingVersion getEncoding();

    /**
     *
     * The name of the connected system (for example, the Berkeley DB
     * environment).
     *
     **/
    ["cpp:const"] string getName();

}; 

};