public synchronized Transaction begin(){
  int transactionId;
  int status;
  if (!init) {
    throw DataUtils.newIllegalStateException(DataUtils.ERROR_TRANSACTION_ILLEGAL_STATE,"Not initialized");
  }
  transactionId=openTransactions.nextClearBit(1);
  if (transactionId > maxTransactionId) {
    throw DataUtils.newIllegalStateException(DataUtils.ERROR_TOO_MANY_OPEN_TRANSACTIONS,"There are {0} open transactions",transactionId - 1);
  }
  openTransactions.set(transactionId);
  status=Transaction.STATUS_OPEN;
  return new Transaction(this,transactionId,status,null,0);
}

public synchronized Transaction begin ( ) { int transactionId ; int status ; if ( ! init ) { throw DataUtils . newIllegalStateException ( DataUtils . ERROR_TRANSACTION_ILLEGAL_STATE , "Not initialized" ) ; } transactionId = openTransactions . nextClearBit ( 1 ) ; if ( transactionId > maxTransactionId ) { throw DataUtils . newIllegalStateException ( DataUtils . ERROR_TOO_MANY_OPEN_TRANSACTIONS , "There are {0} open transactions" , transactionId - 1 ) ; } openTransactions . set ( transactionId ) ; status = Transaction . STATUS_OPEN ; return new Transaction ( this , transactionId , status , null , 0 ) ; }
begin a new transaction .
