def METHOD_NAME(self, must_open_db) :
    self.dbenv = db.DBEnv()
    self.dbenv.set_tx_max(self.num_txns)
    self.dbenv.set_lk_max_lockers(self.num_txns*2)
    self.dbenv.set_lk_max_locks(self.num_txns*2)
    self.dbenv.set_lk_max_objects(self.num_txns*2)
    if self.nosync :
        self.dbenv.set_flags(db.DB_TXN_NOSYNC,True)
    self.dbenv.open(self.homeDir, db.DB_CREATE | db.DB_THREAD |
            db.DB_RECOVER |
            db.DB_INIT_TXN | db.DB_INIT_LOG | db.DB_INIT_MPOOL |
            db.DB_INIT_LOCK, 0666)
    self.db = db.DB(self.dbenv)
    self.db.set_re_len(db.DB_GID_SIZE)
    if must_open_db :
        txn=self.dbenv.txn_begin()
        self.db.open(self.filename,
                db.DB_QUEUE, db.DB_CREATE | db.DB_THREAD, 0666,
                txn=txn)
        txn.commit()