Non-Persistence data showing duplicates which can be seen only in page but NOT in MF while debugging
Non-persistence is associated to the Persistence entity and as following I have an edit page for the data entity where data is manipulated and on the same page, I have a non-persistence entity(Read-only and retrieved via association ) block as well. Opening the page is through the microflow, where a non-persistence record is created and then the page will be displayed. whenever we manipulate the Persistence entity data then non-persistence entity data use to be re-calculated. When we try to open the page multiple times, a non-persistence entity data duplicates in the page multiple times but When I debug the MF retrieve activity shows only one set of non-persistence entity data. it's very strange…!. Also, I observe that only a set of non-persistence entity data is recalculated on the page whenever we manipulate the persistence entity data. So, thus the duplicate data is static but cannot be found in the microflow activity while debugging. May be: whenever we open the page multiple times and exit the page without rollback/committing the data, the client browser has orphan records that display the static data on the page and also newly created data. where only newly created non-persistence entity data is recalculated. Anyone encountered this kind of issue and how do we reslove it.
Not sure what you exactly want to achieve, what your microflows actually execute and setup of the page.
But let me give it a try;
When creating an object, it will exist in memory until its deleted or gets out of scope and is garbage collected
In scope is; as long as it is used in micro/nanoflows, pages or referenced to an object which is kept in memory ( same rules apply)
When you navigate back and forth in the browser and navigation is done using microflows, which also handle the creation of objects you must handle creation of objects more carefully
When navigating back, retrieve the referenced Calc object by association and delete it
When navigating a second time forward (after gone back) retrieve the referenced calc object by association. Check if resulting variable != empty. When not empty, skip object creation. If empty create object.