moved commit from dao to service function.