Wt::Dbo: implement mark&sweep to break circular dependencies
See Wt-interest discussion with Boris Nagaev:
I think, Wt::Dbo should behave as memory manager: longly unused
objects go to swap (i.e. to database, ptr.flush() && ptr.purge()).
Because of lazy loading, this can be done. In this case circular
dependency would not be a problem. Could you implement it, please?
The main problem is that we currently depend on reference counting. What you are really suggesting is that we also do a 'mark' and 'sweep' garbage collection. I've never considered this before, but indeed, it might make sense since Wt::Dbo indeed has a centralized knowledge on all objects, and it has everything in place to implement the traversal. In that case we can simply break the cycle as the corrective action, which should normally lead to a normal (but post-poned) action.
I'm not sure how this will work in practice (how to configure this 'mark&sweep'), but I suspect that in reality most sessions will only have a very low number of objects that are being kept around during user think-time and thus there is indeed opportunity to do this every so many requests.
No data to display