chairemobilite / transition

Transition is a modern new approach to transit planning. It's a web application to model, simulate and plan public transit and alternative transportation.
http://transition.city
MIT License
20 stars 13 forks source link

GTFS import: Database operations should be in a transaction #929

Open tahini opened 2 months ago

tahini commented 2 months ago

If there is an error while importing the GTFS file, it should not leave partial agency data in the DB, especially if it replace an existing agency that was deleted. It should be part of a transaction, but import is a long-running process and to avoid a too long running transaction, all DB operations should be done at the very end of import.

The problem is similar to the duplicate agencies/lines/paths operations (#297), ie a typescript level representation of complete objects to insert/update/delete in a transaction. Saving those objects could be done in a similar way.