code: protected void prepareCommit() throws TransactionAbortedException, LockNotGrantedException
      {
          if (txStatus == Status.STATUS_MARKED_ROLLBACK)
          {
              throw new TransactionAbortedExceptionOJB("Prepare Transaction: tx already marked for rollback");
          }
          if (txStatus != Status.STATUS_ACTIVE)
          {
              throw new IllegalStateException("Prepare Transaction: tx status is not 'active', status is " + TxUtil.getStatusString(txStatus));
          }
          try
          {
              txStatus = Status.STATUS_PREPARING;
              doWriteObjects(false);
              txStatus = Status.STATUS_PREPARED;
          }
          catch (RuntimeException e)
          {
              log.error("Could not prepare for commit", e);
              txStatus = Status.STATUS_MARKED_ROLLBACK;
              throw e;
          }
      }
docs: Prepare does the actual work of moving the changes at the object level
  into storage (the underlying rdbms for instance). prepare Can be called multiple times, and
  does not release locks.
  
  @throws TransactionAbortedException if the transaction has been aborted
  for any reason.
  @throws  IllegalStateException Method called if transaction is
  not in the proper state to perform this operation
  @throws TransactionNotInProgressException if the transaction is closed.