,I*Berkeley DB: DbTxnMgr.begin[P

DbTxnMgr.begin





import com.sleepycat.db.*;

public DbTxn begin(DbTxn pid) throws DbException;





Description



:The DbTxnMgr.begin method creates a new transaction in thetransaction manager,0and returns a DbTxn that uniquely identifies it.

FNote: transactions may not span threads, i.e., each transactionGmust begin and end in the same thread, and each transaction may only beused by a single thread.

FNote: transactions may not span cursors, i.e., each transaction$may only be used by a single cursor.

CNote: transactions may not currently be nested. In a futureHrevision of Berkeley DB, if the pid argument is non-null, the newHtransaction will be a nested transaction, with the transaction indicatedby pid as its parent.

The DbTxnMgr.beginHmethod throws an exception that encapsulates an errno on failure.



Errors

VIf a fatal error occurs in Berkeley DB, the DbTxnMgr.begin method may fail and throw a}DbRunRecoveryException, at which point all subsequent database%calls will also fail in the same way.

The DbTxnMgr.begin&method may fail and throw an exceptionKfor any of the errors specified for the following Berkeley DB and C library functions: abort(3), fcntl(3), fflush(3), fprintf(3),free(3), fsync(3), getpid(3),6DbLog.put, lseek(3), memset(3),mmap(3), munmap(3), shmat(3), shmdt(3), strerror(3), vfprintf(3), vsnprintf(3),and write(3).

In addition, the DbTxnMgr.begin&method may fail and throw an exceptionencapsulating errnofor the following conditions:

P

ENOSPC
The maximum number of concurrent transactions has been reached.




Class

9DbTxnMgr



See Also

DbTxnMgr.begin,JDbTxnMgr.checkpoint,@DbTxnMgr.close,>DbTxnMgr.open,=DbTxnMgr.statandBDbTxnMgr.unlink.
ÿÿ