Db transaction implementation