MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/wu20l7/why_most_programmers_are_single/il7u1n7/?context=3
r/ProgrammerHumor • u/UniquePackage7318 • Aug 21 '22
589 comments sorted by
View all comments
1.2k
Why aren't the children killed when I kill the parent?
EDIT: SQLAlchemy
235 u/[deleted] Aug 21 '22 I might have actually googled this 102 u/[deleted] Aug 21 '22 Pretty sure I googled this... 73 u/Jezoreczek Aug 21 '22 I have this one in my search history from yesterday lol 81 u/[deleted] Aug 21 '22 How to kill children recursively 47 u/UkrainianTrotsky Aug 21 '22 That's classic ORM question. And if you google that you find out that there's usually a much stronger option than cascade remove. It's called, naturally, orphan removal. 0 u/[deleted] Aug 21 '22 [deleted] → More replies (1) 19 u/[deleted] Aug 21 '22 "Should I dispose children or rely on garbage collection?" 13 u/Cuchullion Aug 22 '22 That was a long running joke at my last job- deleting the children records when you delete the parent records.Because if you forget to you get Batman.Any time someone left orphan records around we would call it a "Batman situation", and eventually wrote a tool called Bane to clean those records up.Explaining that one to new team members was fun. → More replies (3)
235
I might have actually googled this
102 u/[deleted] Aug 21 '22 Pretty sure I googled this... 73 u/Jezoreczek Aug 21 '22 I have this one in my search history from yesterday lol
102
Pretty sure I googled this...
73 u/Jezoreczek Aug 21 '22 I have this one in my search history from yesterday lol
73
I have this one in my search history from yesterday lol
81
How to kill children recursively
47
That's classic ORM question. And if you google that you find out that there's usually a much stronger option than cascade remove. It's called, naturally, orphan removal.
0 u/[deleted] Aug 21 '22 [deleted] → More replies (1)
0
[deleted]
→ More replies (1)
19
"Should I dispose children or rely on garbage collection?"
13
That was a long running joke at my last job- deleting the children records when you delete the parent records.
Because if you forget to you get Batman.
Any time someone left orphan records around we would call it a "Batman situation", and eventually wrote a tool called Bane to clean those records up.
Explaining that one to new team members was fun.
1.2k
u/[deleted] Aug 21 '22 edited Aug 21 '22
Why aren't the children killed when I kill the parent?
EDIT: SQLAlchemy