How do I make sure I delete Latitude/Longitude values for Maps widget once Im done
I’m making an App to visualize some data that is stored elsewhere. I currently have a list of locations and want to plot them using the maps widget. Ideally, everything is non-persistable but this is not possible for the maps widget. Therefore, I want to persist my ‘Location’ entity (which only contains the Lat/Long values but never commit it. However, it seems that either the rest call to generate the Lat/Long from the addresses I already have OR the map widget itself commits them automatically. So, next I want to make sure I delete all of the Location objects (for my session) as quickly as possible. I first associated Location to System.Session and implemented delete behaviour but this has not seemed to work. The Location objects still remain after I have shut down the app and left it for some time. Any advice on how to proceed?
The Answer is what Daan commented above. I had not actually set the association between the objects and the session object. I had thought as they were created in the session they belong to it so it would work. However, delete behaviour doesn’t care about that, only the literal associations. Thanks Daan!
make sure to setting correctly Cascading delete for association.