1. Shawn Davis
  2. PowerServer
  3. Monday, 24 April 2023 21:48 PM UTC

Hi All,

I'm having some issues with a Powerserver 2022 app that if left open at the end of the day seems to close spontaneously leaving the program running as a task in the background (which could possibly be a sperate thread we create for a certain task). This prevents them from opening it the next mroning because the updater says that the program directory is in use. This is a bit a support nightmare obviously. Especially currently while we're doing new code updates every week.

Should the app be able to stay open over many days or is that not good?

Is the connection tolerant to internet outages and brownouts?

And what about apps that are open when we update the server with new code? It seems to cause them to crash from my experience.

Thanks in advance,

Shawn

mike S Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 17:30 PM UTC
  2. PowerServer
  3. # 1

If keeping the app open over many days and making it somewhat tolerant to internet outages, then you should experiment with getting and updating the session token to see if you can handle it:

You could try and reset the access token when you get a session expired error.  You would have to turn on the begin session by code option.

 

RestClient.GetJWTToken( ls_Url, ls_PostData, ls_Response )

Parser.LoadString(ls_Response)
is_tokenType = Parser.GetItemString("/token_type")
ls_token = Parser.GetItemString("/access_token")

app.SetHttpRequesTheader("Authorization", is_tokenType + " " + ls_token, true)

 

 

 

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 00:17 AM UTC
  2. PowerServer
  3. # 2

Hi Shawn;

  Typically, there are App, internet, DB, etc timeouts that come into effect when PS App's are left open. Also, not to mention network outages, etc that can damage these open sessions as well (there is no automatic recovery for that in PS).

   I would strongly suggest that you implement an automatic log off (app shutdown) using the Application Objects IDLE event. That will fire when the App is not being used (aka not active). Closing the App at this point will then close all the n-tier connections. Thus, DB locks, PS thread, IIS session, etc connections will be properly cleaned up - not to mention the App thread as well. That should then also prevent App restarting issues as well. HTH

Regards ... Chris 

Comment
  1. Shawn Davis
  2. Tuesday, 25 April 2023 15:19 PM UTC
Thanks for your input Chris. I was hoping that PS would improve the resiliency of the connection. You and I know the technical difficulties but users just know they don't have these issues with Teams or Trello etc. Oh well....
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 25 April 2023 20:27 PM UTC
Hi Shawn;

I have implemented the above IDLE feature in my STD framework and it works great - even for older C/S Apps and the older Appeon Web and Appeon Mobile products as well as PS Apps.

Another alternative is to implement a "Heart Beat" feature to keep all these sessions active. AKA "Keep Alive" feature. I have also implemented this as well in my STD framework since 2018. That also corrects this situation for C/S, PowerClient and PowerServer Apps.

FYI: http://chrispollach.blogspot.com/2018/02/ifc2018r1.html

HTH
  1. Helpful 1
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.