code: public void close() throws ODMGException
      {
          /**
           * is the DB open? ODMG 3.0 says we can't close an already open database.
           */
          if (!isOpen())
          {
              throw new DatabaseClosedException("Database is not Open. Must have an open DB to call close.");
          }
          /**
           * is the associated Tx open? ODMG 3.0 says we can't close the database with an open Tx pending.
           * check if a tx was found, the tx was associated with database
           */
          if (odmg.hasOpenTransaction() &&
                  getTransaction().getAssociatedDatabase().equals(this))
          {
              String msg = "Database cannot be closed, associated Tx is still open." +
                      " Transaction status is '" + TxUtil.getStatusString(getTransaction().getStatus()) + "'." +
                      " Used PBKey was "+getTransaction().getBroker().getPBKey();
              log.error(msg);
              throw new TransactionInProgressException(msg);
          }
          isOpen = false;
          // remove the current PBKey
          pbKey = null;
          // if we close current database, we have to notify implementation instance
          if (this == odmg.getCurrentDatabase())
          {
              odmg.setCurrentDatabase(null);
          }
      }
docs: Close the database.
  After you have closed a database, further attempts to access objects in the
  database will cause the exception <code>DatabaseClosedException</code> to be thrown.
  Some implementations may throw additional exceptions that are also derived
  from <code>ODMGException</code>.
  @exception ODMGException Unable to close the database.