Added blocking function for direct access to the database.