Correction for missing commit of data into SQL database in legacy code and add test to avoid future regression.