1. Shawn Davis
  2. PowerServer
  3. Wednesday, 10 May 2023 23:14 PM UTC

We're getting this error when we try to close our app after it has sat idle for several hours. Is there something we should do to keep it active?

-Shawn

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 11 May 2023 00:05 AM UTC
  2. PowerServer
  3. # 1

Hi Shawn;

  I would implement a "Heartbeat" feature like I've implemented in my STD Framework. Each App can have its own HB timer & DML command. Thus not only does this solve the PS session timeout but any DB timeouts as well.

  Personally, I don't like playing with these timeouts in the web server, PS server or DB server as the defaults are typically designed to capture other processes (apps) that are not behaving up to default standards.

  Also, don't forget to code the App's IDLE event as well to shutdown the app after no user activity. This not only chews up a PS session but that also chews up your PS license's active count. So for example you have a 150 license. You normally run 120-140 concurrent users in your PS apps but, now 25 users have their apps minimized & still running. This means your using your 150 license count & only 125 new app users can log into your system. The other 15 users at peak times will not be allowed to start the App. 

Food for thought.  ;-)

Regards .... Chris

Comment
  1. Shawn Davis
  2. Friday, 12 May 2023 14:50 PM UTC
So, we had a heartbeat set to every 60 seconds. My programmer decide we didn't need it, disabled it. ?



Do you have any recommendation for how often it should run?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 12 May 2023 15:02 PM UTC
Hi Shawn;

LOL - well, that was an Ooops! ;-)

The HB timer interval is up to you. Personally, 60 seconds is quite frequent but not stressful on either PS or the resulting DBMS.

Personally, I would aim for a 50% value of the current shortest timeout value. So say if your working on a 3600 second (60 minute) default - I would set your HB timer to 600 - 1,800 seconds (10 to 30 minutes). Just my $0.02 HTH

Regards .. Chris
  1. Helpful 1
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Thursday, 11 May 2023 03:36 AM UTC
  2. PowerServer
  3. # 2

Hi Shawn,

Just like Chirs suggested, a "Heartbeat" feature is necessary if you want to keep the session alive. 

I want to add more tips:

1) Make sure you are setting a proper Session Timeout value according to your requirement: Configure the timeout settings - - PowerServer 2022 Help (appeon.com)

2) If your app is deployed on IIS, please also notice the IIS application pools may cause the session to become invalid: Session does not exist - - PowerServer 2022 Help (appeon.com)

3) You can also handle this SystemError to provide a user-friendly message if you don't have enough sessions.

Regards, Logan

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.