﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	difficulty
4597	Saving metadata and all changes automatically in destructor as default policy.	srokap		"Previously discussed here: https://docs.google.com/document/d/1NrxIj4YOTjNbeXDGW3tpz2lNvaRwL2NDPBNd7TgRfFk/edit?disco=AAAAAEr6svk

This is actually a bit of logic change. Motivation is to reduce writing calls as much as possible to make life easier for deployments with single master and multiple read replicas. This change allows us to hopefully make single call to DB. We also may change metadata multiple times (increment?) without additional cost - we save final version. It's tricky because we may sometimes want to make immediate write, but i think this could be made by some explicit call (ElggEntity->save(params)?) instead of default policy. I also remember Cash speaking something about making writes to DB as late as possible, it would follow the same path.

We might consider saving metadata and all changes automatically in destructor. We tried such concept successfully. Note that also some related bugs were fixed in PHP: https://bugs.php.net/bug.php?id=30210"	Enhancement	new	normal	Needs Review	Core	1.8	minor			brett@…	
