Re:Is ORM still an anti-pattern?
by Ygg2 on Tuesday June 27, 2023 @04:48PM
(#36498423)
There are two approaches.
ActiveRecord approach. Objects aren't kept in cache calling update like that won't update other object in memory. Each time you call select you get a different object.
Hibernate approach. Object are kept in cache and running update will update existing objects in memory because each select returns the same object.
Re:Is ORM still an anti-pattern?
by amluto on Tuesday June 27, 2023 @05:14PM
(#36498765)
The only one I gave experience with is SqlAlchemy (1.x). You certainly can do a query builder update and get current subsequent data out of ORM objects, but itβs really easy to mess up, at least in my experience.
ActiveRecord approach. Objects aren't kept in cache calling update like that won't update other object in memory. Each time you call select you get a different object.
Hibernate approach. Object are kept in cache and running update will update existing objects in memory because each select returns the same object.
SqlAlchemy does permit both.