citier
citier copied to clipboard
Combine Parent.save and Child.save to the same transaction.
When the parent record saved, we already get the id of the child record. If we do the query before child record persisted into the table, it will raise RecordNotFound exception.
I tried to combine Parent save and Child save into the same transaction and then the problem gone. I'm not sure whether there will be side effects yet and will keep monitoring how it works in the server.
Any thoughts on this PR? Thanks.