track objects changes and to avoid server round trip It simple two level array storage • First level keys are ClassNames • Second level keys are object IDs.
Fetch entities from the database or create new and persist ‘em (Repo|UOW) • 2) Update some of entities directly or using wrapper like Form (uses PropertyAccess) • Remove some, if needed (Forms etc.) • 3) EM->flush() changes (UOW)
Open DB transaction • Complute change-sets for update • Iterate over scheduled inserts, updates, deletes • Delegate to entity persister SQL generation and execution • Clear UOW on success • Close DB transaction
• Make flush cheaper ◦ Mark entities as readOnly ◦ Chang tracking policy to DEFERRED_EXPLICIT or NOTIFY ◦ Provide flush arguments (applies objects and arrays)