From the unit of work pattern i uderstand a method of doing typic transactions based on some domain repostiries (using a repository per domain object) . Example : after defining some repository objects in the UoW object , commit those repositories based on theyr state .
Also the repositories should not contain any transaction logic .
What happens when an insert() leads to a creation of a new object (auto generated id) that later on is needed by another object in the same transaction ?
Unit of work does not seem to work for this case . There could be even more specific and complex transaction where objects are generated when the UoW commit is ran .
How should the transactions be treated in this case ?