This Question is Possibly Answered

1 "correct" answer available (8 pts) 15 "helpful" answers available (5 pts)
3 Replies Last post: Nov 17, 2008 4:58 PM by Duke  
ABC XYZ BlackBelt 285 posts since
Mar 6, 2008
Currently Being Moderated

Nov 17, 2008 12:13 AM

Persistent Data Duration

Hi

 

I want to clear my CSPD upon closing my application from browser or from Right-Top-Corner Close button of title bar (in case of detached applet).

How to do that ?

 

I have two approaches. One is to specify "duration" flag in "persistent-data" settings. But it seems that the minimal duration unit is in days. I want to specify the duration as minutes/hours. And the second option will if there is a way to clear the CSPD forcefully upon applet close. How I can achieve this ?

 

Thank you.

Christopher Barber BlackBelt 137 posts since
Sep 27, 2007
Currently Being Moderated
1. Nov 17, 2008 12:26 PM in response to: ABC XYZ
Re: Persistent Data Duration

As you have noted, the duration is in units of days, so it won't be useful for your purpose.

 

You should be able to clear the repository by calling methods directly on the Repository object. I believe something like this should work:

 


{define-proc {clear-repository}:void
    def repository = {get-persistent-data-repository}
    {repository.clear}
    {repository.commit}
}

 

Duke BlackBelt 294 posts since
Oct 17, 2007
Currently Being Moderated
3. Nov 17, 2008 4:58 PM in response to: ABC XYZ
Re: Persistent Data Duration

You can use {register-exit-proc clear-repository}, which will get called as long as the RTE does not crash - which would prevent the applet from executing this exit handler.  An applet will eventually exit as long as the RTE does not crash first.  I forget if non-IE browsers might keep applets alive even after their window is closed if the browser is still running (maybe other windows of the browser are still open) - something to think about.  So if your users will be using non-IE browsers, you probably cannot count on having the applet exit soon enough if you want to restrict the persistent data duration to minutes or hours.

 

I think this question came up before in this forum, and the suggestion was that you should have a time stamp as part of your persistent data, and then when an applet starts or needs the data, the applet itself can clear the data if the data is too old.  That would let you enforce shorter durations.

More Like This

  • Retrieving data ...