head 1.2; access; symbols RPM_4_2_1:1.1.1.5 RPM_4_2:1.1.1.5 RPM_4_1_1:1.1.1.5 RPM_4_1:1.1.1.4 RPM_4_0_5:1.1.1.3 RPM_4_0_4:1.1.1.2 RPM_4_0_3:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.53.30; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2002.01.08.00.30.10; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2003.01.18.13.48.59; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2001.12.06.00.08.06; author rse; state Exp; branches; next 1.1.1.5; 1.1.1.5 date 2003.01.18.14.04.58; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @
DbEnv::txn_begin |
![]() ![]() |
#include <db_cxx.h>int DbEnv::txn_begin(DbTxn *parent, DbTxn **tid, u_int32_t flags);
The DbEnv::txn_begin method creates a new transaction in the environment and copies a pointer to a DbTxn that uniquely identifies it into the memory to which tid refers.
If the parent argument is non-NULL, the new transaction will be a nested transaction, with the transaction indicated by parent as its parent. Transactions may be nested to any level. In the presence of distributed transactions and two-phase commit, only the parental transaction, that is a transaction without a parent specified, should be passed as an argument to DbTxn::prepare.
The flags value must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
This behavior may be set for a Berkeley DB environment using the DbEnv::set_flags interface. Any value specified in this interface overrides that setting.
This behavior is the default for Berkeley DB environments unless the DB_TXN_NOSYNC flag was specified to the DbEnv::set_flags interface. Any value specified in this interface overrides that setting.
Note: A transaction may not span threads; that is, each transaction must begin and end in the same thread, and each transaction may be used only by a single thread.
Note: Cursors may not span transactions; that is, each cursor must be opened and closed within a single transaction.
Note: A parent transaction may not issue any Berkeley DB operations -- except for DbEnv::txn_begin, DbTxn::abort and DbTxn::commit -- while it has active child transactions (child transactions that have not yet been committed or aborted).
The DbEnv::txn_begin method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.
The DbEnv::txn_begin method may fail and throw an exception or return a non-zero error for the following conditions:
The DbEnv::txn_begin method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the DbEnv::txn_begin method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.
![]() ![]() |
Copyright Sleepycat Software
@
1.1
log
@Initial revision
@
text
@d1 1
a1 1
@
1.1.1.1
log
@Import: RPM 4.0.3
@
text
@@
1.1.1.2
log
@Import: RPM 4.0.4
@
text
@d1 1
a1 1
d17 1
a17 1
a30 3
Calling the DbTxn::abort,
DbTxn::commit or DbTxn::discard methods will discard the returned
handle.
d60 1
a60 1
DB_TXN_NOSYNC flag was specified to the DbEnv::set_flags
a98 1
DbTxn::set_timeout
d103 1
a103 1
@
1.1.1.3
log
@Import: RPM 4.0.5
@
text
@d1 2
a2 2
a3 1
d57 2
a58 4
of this transaction,
return DB_LOCK_NOTGRANTED or throw a
DbLockNotGrantedException
immediately instead of blocking on the lock.
d84 4
a87 4
If a catastrophic error has occurred, the DbEnv::txn_begin method may fail and
either return DB_RUNRECOVERY or throw a
DbRunRecoveryException,
in which case all subsequent Berkeley DB calls will fail in the same way.
d89 1
a89 1
DbEnv, DbTxn
d91 14
a104 1
Transaction Subsystem and Related Methods
@
1.1.1.4
log
@Import: RPM 4.1
@
text
@d1 2
a2 2
d4 1
d58 4
a61 2
of this transaction, return immediately instead of blocking on the lock.
The error return in the case will be DB_LOCK_NOTGRANTED.
d87 4
a90 4
If a catastrophic error has occurred, the DbEnv::txn_begin method may fail and either
return DB_RUNRECOVERY or throw an exception encapsulating
DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail
in the same way.
d92 1
a92 1
DbEnv, DbTxn
d94 1
a94 14
DbEnv::set_tx_max,
DbEnv::set_tx_recover,
DbEnv::set_tx_timestamp,
DbTxn::abort,
DbEnv::txn_begin,
DbEnv::txn_checkpoint,
DbTxn::commit,
DbTxn::discard,
DbTxn::id,
DbTxn::prepare,
DbEnv::txn_recover,
DbTxn::set_timeout
and
DbEnv::txn_stat.
@
1.1.1.5
log
@Import: RPM 4.1.1
@
text
@d1 2
a2 2
a3 1
d57 2
a58 4
of this transaction,
return DB_LOCK_NOTGRANTED or throw a
DbLockNotGrantedException
immediately instead of blocking on the lock.
d84 4
a87 4
If a catastrophic error has occurred, the DbEnv::txn_begin method may fail and
either return DB_RUNRECOVERY or throw a
DbRunRecoveryException,
in which case all subsequent Berkeley DB calls will fail in the same way.
d89 1
a89 1
DbEnv, DbTxn
d91 14
a104 1
Transaction Subsystem and Related Methods
@