I do think it makes sense to "commit" the record to the database at this point - if you have stored the file you must also store the DB record at the same time (and perhaps also catch any DB exception and remove the file?).

I think what concerns me is that we find it good practice to keep `flush` operations to the absolute minimum to increase performance, and having anything that calls a `flush` for each operation is bad.

I would like to see something in Doctrine that will automatically flush at the end of a request only IF there are things scheduled, by calling something like `scheduleFlush()`. Not sure if that is possible. If not maybe an option is a good idea.