~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/txn/txn_method.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.10.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 128.
  • Revision ID: james.westby@ubuntu.com-20100517170206-xu1wmjuy40nt2sk0
Tags: upstream-2.30.1
ImportĀ upstreamĀ versionĀ 2.30.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*-
2
 
 * See the file LICENSE for redistribution information.
3
 
 *
4
 
 * Copyright (c) 1996-2002
5
 
 *      Sleepycat Software.  All rights reserved.
6
 
 */
7
 
 
8
 
#include "db_config.h"
9
 
 
10
 
#ifndef lint
11
 
static const char revid[] = "$Id$";
12
 
#endif /* not lint */
13
 
 
14
 
#ifndef NO_SYSTEM_INCLUDES
15
 
#include <sys/types.h>
16
 
 
17
 
#ifdef HAVE_RPC
18
 
#include <rpc/rpc.h>
19
 
#endif
20
 
 
21
 
#include <string.h>
22
 
#endif
23
 
 
24
 
#include "db_int.h"
25
 
#include "dbinc/txn.h"
26
 
 
27
 
#ifdef HAVE_RPC
28
 
#include "dbinc_auto/db_server.h"
29
 
#include "dbinc_auto/rpc_client_ext.h"
30
 
#endif
31
 
 
32
 
static int __txn_set_tx_max __P((DB_ENV *, u_int32_t));
33
 
static int __txn_set_tx_timestamp __P((DB_ENV *, time_t *));
34
 
 
35
 
/*
36
 
 * __txn_dbenv_create --
37
 
 *      Transaction specific initialization of the DB_ENV structure.
38
 
 *
39
 
 * PUBLIC: void __txn_dbenv_create __P((DB_ENV *));
40
 
 */
41
 
void
42
 
__txn_dbenv_create(dbenv)
43
 
        DB_ENV *dbenv;
44
 
{
45
 
        /*
46
 
         * !!!
47
 
         * Our caller has not yet had the opportunity to reset the panic
48
 
         * state or turn off mutex locking, and so we can neither check
49
 
         * the panic state or acquire a mutex in the DB_ENV create path.
50
 
         */
51
 
 
52
 
        dbenv->tx_max = DEF_MAX_TXNS;
53
 
 
54
 
#ifdef HAVE_RPC
55
 
        if (F_ISSET(dbenv, DB_ENV_RPCCLIENT)) {
56
 
                dbenv->set_tx_max = __dbcl_set_tx_max;
57
 
                dbenv->set_tx_timestamp = __dbcl_set_tx_timestamp;
58
 
                dbenv->txn_checkpoint = __dbcl_txn_checkpoint;
59
 
                dbenv->txn_recover = __dbcl_txn_recover;
60
 
                dbenv->txn_stat = __dbcl_txn_stat;
61
 
                dbenv->txn_begin = __dbcl_txn_begin;
62
 
        } else
63
 
#endif
64
 
        {
65
 
                dbenv->set_tx_max = __txn_set_tx_max;
66
 
                dbenv->set_tx_timestamp = __txn_set_tx_timestamp;
67
 
                dbenv->txn_checkpoint = __txn_checkpoint;
68
 
#ifdef CONFIG_TEST
69
 
                dbenv->txn_id_set = __txn_id_set;
70
 
#endif
71
 
                dbenv->txn_recover = __txn_recover;
72
 
                dbenv->txn_stat = __txn_stat;
73
 
                dbenv->txn_begin = __txn_begin;
74
 
        }
75
 
}
76
 
 
77
 
/*
78
 
 * __txn_set_tx_max --
79
 
 *      Set the size of the transaction table.
80
 
 */
81
 
static int
82
 
__txn_set_tx_max(dbenv, tx_max)
83
 
        DB_ENV *dbenv;
84
 
        u_int32_t tx_max;
85
 
{
86
 
        ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_tx_max");
87
 
 
88
 
        dbenv->tx_max = tx_max;
89
 
        return (0);
90
 
}
91
 
 
92
 
/*
93
 
 * __txn_set_tx_timestamp --
94
 
 *      Set the transaction recovery timestamp.
95
 
 */
96
 
static int
97
 
__txn_set_tx_timestamp(dbenv, timestamp)
98
 
        DB_ENV *dbenv;
99
 
        time_t *timestamp;
100
 
{
101
 
        ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_tx_timestamp");
102
 
 
103
 
        dbenv->tx_timestamp = *timestamp;
104
 
        return (0);
105
 
}