How to efficiently detach an entity and it's relationships? #10908
Unanswered
nitwhiz
asked this question in
Support Questions
Replies: 1 comment
-
So I just stumbled over Transitive persistence / Cascade Operations when researching something completely different and there's something about Would that do what I ask for? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have something like this:
If I detach this entity now, it's
ActorAttribute
entities are still attached. How would I detach "everything related", without having to write a specific detach for every entity?Just to be sure we don't get a XY-problem here
My main goal is to clear the entity manager, but only remove a (not really small, 16 items) list of entities from the entity manager. I'm dealing with a long-ish running process, batch processing up to ~300.000 rows of data. I observed that the processing rate gets absurdly low (< 10 rows per second), after it gets going with a couple 100 rows per second for the first 5 secs. (i know, "rows per second" is a very esoteric unit, it's just to bring my point across: entity handling gets slow.)
After implementing a
clear
(withflush
before) every X seconds, keeping the other entities around across theclear
s, i get a pretty consistent processing rate of nearly 100 rows per second.As keeping the other entities, which aren't to be cleared, around is an absolute PITA, how should I go for this?
Beta Was this translation helpful? Give feedback.
All reactions