add concurrent access for DB and add some test code