A transaction can be used by more than one thread. @return A newly created transaction.
A transaction can be used by more than one thread. @return A newly created transaction.
This method must be called before any write operation is performed.
Transactions may only span threads if they do so serially; that is, each transaction must be active in only a single thread of control at a time.
This restriction holds for parents of nested transactions as well; no two children may be concurrently active in more than one thread of control at any one time.
Cursors may not span transactions; that is, each cursor must be opened and closed within a single transaction.
A parent transaction may not issue any Berkeley DB operations -- except for {@link com.sleepycat.db.Environment#beginTransaction Environment.beginTransaction}, {@link com.sleepycat.db.Transaction#abort Transaction.abort} and {@link com.sleepycat.db.Transaction#commit Transaction.commit} --while it has active child transactions (child transactions that have not yet been committed or aborted).
@param parent If the parent parameter 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 parameter to {@link com.sleepycat.db.Transaction#prepare Transaction.prepare}.
@param config The transaction attributes. If null, default attributes are used.
@return The newly created transaction's handle.
@throws DatabaseException if a failure occurs.
Transaction handles are free-threaded; transactions handles may be used concurrently by multiple threads.
Cursors may not span transactions; that is, each cursor must be opened and closed within a single transaction. The parent parameter is a placeholder for nested transactions, and must currently be null.
@param txnConfig The transaction attributes. If null, defaultattributes are used. @return The newly created transaction's handle. @throws com.sleepycat.je.rep.InsufficientReplicasException if the Masterin a replicated environment could not contact a quorum of replicas as determined by the {@link ReplicaAckPolicy}. @throws com.sleepycat.je.rep.ReplicaConsistencyException if a replicain a replicated environment cannot become consistent within the timeout period. @throws EnvironmentFailureException if an unexpected, internal orenvironment-wide failure occurs. @throws UnsupportedOperationException if this is not a transactionalenvironment. @throws IllegalStateException if this handle or the underlyingenvironment has been closed. @throws IllegalArgumentException if an invalid parameter is specified,for example, an invalid {@code TransactionConfig} parameter.Callers are responsible for explicitly calling {@linkplain Transaction#commit()}or {@linkplain Transaction#rollback()} when they no longer need the{@code Transaction}. The {@code Transaction} returned by this call willbe considered the current transaction until one of the following happens:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|