code: public synchronized void open(String name, int accessMode) throws ODMGException
      {
          if (isOpen())
          {
              throw new DatabaseOpenException("Database is already open");
          }
          PersistenceBroker broker = null;
          try
          {
              if (name == null)
              {
                  log.info("Given argument was 'null', open default database");
                  broker = PersistenceBrokerFactory.defaultPersistenceBroker();
              }
              else
              {
                  broker = PersistenceBrokerFactory.createPersistenceBroker(
                          BrokerHelper.extractAllTokens(name));
              }
              pbKey = broker.getPBKey();
              isOpen = true;
              //register opened database
              odmg.registerOpenDatabase(this);
              if (log.isDebugEnabled()) log.debug("Open database using PBKey " + pbKey);
          }
          catch (PBFactoryException ex)
          {
              log.error("Open database failed: " + ex.getMessage(), ex);
              throw new DatabaseNotFoundException(
                      "OJB can't open database " + name + "\n" + ex.getMessage());
          }
          finally
          {
              // broker must be immediately closed
              if (broker != null)
              {
                  broker.close();
              }
          }
      }
docs: Open the named database with the specified access mode.
  Attempts to open a database when it has already been opened will result in
  the throwing of the exception <code>DatabaseOpenException</code>.
  A <code>DatabaseNotFoundException</code> is thrown if the database does not exist.
  Some implementations may throw additional exceptions that are also derived from
  <code>ODMGException</code>.
  @param name The name of the database.
  @param accessMode The access mode, which should be one of the static fields:
  <code>OPEN_READ_ONLY</code>, <code>OPEN_READ_WRITE</code>,
  or <code>OPEN_EXCLUSIVE</code>.
  @exception ODMGException The database could not be opened.