Cast currentuser > cache or database?

0
I have this association from Account to SomeEntity (many-to-many). Now I remove SomeEntity objects from that account, without committing. Next time I get the account by casting the currentuser, I still see these objects connected to the SomeEntity. Is this intentional? Is there a way to get the up-to-date local version of the Account object? -------- EDIT --------- More specifically, I have an account associated to 'Activities'. On the page, users are able to add/remove groups of activities as well as individual activities from/to their account. This means that the activities belonging to the selected group should be associated to the account or specific associations between activities and the account need to be removed. In Mendix, this translates to the 'Change object activity', where I Add/Remove Activity objects to/from the Account object.   ------- EDIT 2 ------ Steps: User clicks Add button inside an ActivityGroup, which triggers MF Account is retrieved via currentUser Cast Activities related to selected Activity are retrieved from DB Change object is 'adding' those Activities to Account - Activity association (including refresh) Result, all activities in the group are shown on the page. User clicks Remove button inside an Activity, which triggers MF Account is retrieved via currentUser Cast Debugging shows me that Account - Activity association is empty (so this already shows enough) Change object is 'removing' single Activity from Account - Activity association (including refresh) Result, all activities are now removed on the page.
asked
2 answers
1

Try to change the association to empty instead of deleting the object without committing.  I think this will do the trick.

What's the reason to do a delete but never a commit?

answered
0

Hi,

I think you should get the cached data from currentUser. But I remember that we also sometimes encountered unexpected behaviour (but in older Mendix versions) with currentUser.

What are you doing between those steps (i.e. change association / inspect association)?

Can you check the client cache (Ctrl+Alt+G in the browser)?

answered