Removed unused BO from session


Author
Message
ChanKK
ChanKK
StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,
As SF's web page create and store BO instance at session. Anyway to remove unused BO instance without need to wait till session timeout?

For example, when navigate to Form A, it uses BOA, BOB and BOC,
when navigate to FormB, it uses BOX, BOY and BOZ.

My question is, since BOA, BOB and BOC no longer needed, how to clear them?
I was thinking to override SF Base Page and add prefix to BO session name. Before InitializeBusinessObject and NOT postback, remove all BOs from session which its session name with prefix as desired. However, it might not works as end user might open more than one page at the same time (FormA and Form in 2 browser tabs).

Any advice?

Thank you
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, you can remove the BOs from the session as they are just stored in the session with the name of the property:

public MyBo Business1{.....}


In the above example, the Session variable should be Session["Business1"].  However, this can be dangerous as the BasePage will be expecting them and will ultimately take the logic out of the framework and place it in your hands as to make sure that these sessions get restored.
ChanKK
ChanKK
StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi
The problem is, I don't know when to release it.. because I am not sure if it is still in used by other page... or just hanging... unless session expired
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search