You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found some non-obvious behavior: when creating Entity by EntityClass.new with all fields population, then accessing any prop at first time leads to querying this entity from DB. This last query was unexpected for me if I populate all props upon creation.
Internally this is because upon save Entity._readValues backing field is null and written doesn't cached in it.
I think Entity should cache inserted values and return them without additional queries...or maybe I've missed something and this behavior considered as normal?
The text was updated successfully, but these errors were encountered:
You are absolutely right about excessive query to retrieve just inserted values for new entities.
We fixed that in d5bef3c , feel free to test and thank you for attention.
Found some non-obvious behavior: when creating
Entity
byEntityClass.new
with all fields population, then accessing any prop at first time leads to querying this entity from DB. This last query was unexpected for me if I populate all props upon creation.Internally this is because upon save
Entity._readValues
backing field is null and written doesn't cached in it.I think
Entity
should cache inserted values and return them without additional queries...or maybe I've missed something and this behavior considered as normal?The text was updated successfully, but these errors were encountered: