def maprdb_connect(): """ Ensures that we connect to DB only once. :return: Connection object """ global connection if not connection: connection = maprdb.connect(mapr_home=os.path.dirname(__file__)) return connection
def open_db(): print("opening db") return (maprdb.connect())
def maprdb_get_table(path): print("opening table %s" % path) connection = maprdb.connect() return (connection.get(path))
def test_no_two_jvm(self): with self.assertLogs(level=logging.WARN): maprdb.connect() # not raises exception, but warning about inability to start second JVM
def open_db(): return (maprdb.connect())
def open_db(): logging.debug("opening db") return (maprdb.connect())