Lazy Removal from PersistentBag collection (Similar to Add operation) #2776
-
Hi there, Is there a way in Bag to remove the items from it in lazy mode similar to add method? The main issue that we have today is when we remove items from the Bag, it initializes all the items in bag and then remove it. This leads to increse in time for bigger datasets as complete data of collection is loaded in memory (Sometimes millions of records). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The bag semantic does not allow lazy delete. Use a list, a map or a set instead. Of course if your bag can be mapped as a set, a list or a map, then it is not really a bag. |
Beta Was this translation helpful? Give feedback.
The bag semantic does not allow lazy delete. Use a list, a map or a set instead. Of course if your bag can be mapped as a set, a list or a map, then it is not really a bag.
In usual data-models, most if not all collections really should be mapped as sets.