FERM-37 fixing ordering of opening and creating db file