Batch apply: one transaction, three lists
Last post looked at TTSession<T>, the unit-of-work layer: you hand it a list, work on clones, and mark each one with Insert, Update or Delete. This post is about the other way to write a batc...
Last post looked at TTSession<T>, the unit-of-work layer: you hand it a list, work on clones, and mark each one with Insert, Update or Delete. This post is about the other way to write a batc...
Back in Why Trysil uses full-clone in TTSession, we argued why TTSession<T> clones every entity on entry and drives state with explicit API calls. That post was about the why. This one is abo...
Trysil 2.0.0 is out. The changelog is long, and it opens with a sentence that is not the usual release-note tone: This section carries twenty-two compilation breaks and eighty-four breaks the c...
Here’s a pattern that shows up in almost every ORM-backed codebase, written by people who don’t realize it: LOrder := LContext.Get<TOrder>(42); // ... do something ... LOtherOrder := LContex...
A TOrder has a CustomerID. Sometimes, when the code holds an order, it also needs the Customer. Sometimes it doesn’t. A naïve ORM fetches the customer eagerly on every Get<TOrder>. That’s si...
Two users open the same invoice. Alice edits the amount and clicks Save. Bob, a minute later, edits the customer and clicks Save. Alice’s amount is gone. Bob overwrote it with the value he loaded a...
The previous post ended with a promise: after hooks exist, we’ll come back to them. This is that post. Trysil has two complementary mechanisms for reacting to persistence operations. One is the me...
Most ORMs treat validation as someone else’s problem. You write your entities; you write your service layer; somewhere in that service layer there’s a Validate(entity) method that nobody maintains ...
Attribute-driven SQL is where most ORMs earn their keep. [TTable], [TColumn], [TJoin], a filter — and the framework hands you back typed entities. It covers 80% of real queries. The remaining 20% ...
Delphi has FireDAC. FireDAC already talks to SQLite, PostgreSQL, Firebird, SQL Server, MySQL, Oracle, and a handful of others. If connectivity is a solved problem, why does Trysil need a driver lay...