If your battery is weak (even if it is new), the voltage drop during cranking could be resetting your computer every time you start the car. Check your voltage before, during and after cranking.
Also, ECU usually has a constant 12V supply to keep the memory. (That is in addition to ignition switched 12V). If that source has gone bad. Your will reset the computer EVERY time you shut it off.