db: fixed insert() and update() when no db connection
db unit tests updated