1. Pere Mascaró
  2. PowerServer
  3. Tuesday, 12 November 2024 11:37 AM UTC

Hello,

My application in Powerserver disconnects the session after a period of inactivity. I have configured the "session:timeout" property to 0, but it still disconnects after a certain amount of time without use. I need the session to never close, as some users may be inactive for a while while attending to customers, but then they need to create an invoice and the session has already been disconnected.

Thank you.

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 12 November 2024 14:39 PM UTC
  2. PowerServer
  3. # Permalink

Hi, Pere -

Some databases can be configured to drop connections after a configurable period of inactivity. I suggest you check with your DBMS Administrator to see if this could be the cause of the issue.

A tried-and-true workaround that has been used forever is for the application to issue a trivial query to the database (one that uses minimal resources) from the application object's Idle event, the timing of which can be configured via the PowerScript Idle function - For example, Idle(1800) will cause the application to execute the Idle event after 30 minutes (1800 seconds) of inactivity. This is commonly referred to as a "keep alive" feature.

Best regards, John

Comment
  1. Pere Mascaró
  2. Tuesday, 12 November 2024 15:57 PM UTC




Hi John,



Yes, it’s something I hadn’t thought of. It would be a good option for me.



Thank you.

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 12 November 2024 15:45 PM UTC
  2. PowerServer
  3. # 1

Hi Pere;

  FWIW: Another approach would be to add a "Heart Beat" feature to your PS Apps. That approach can address these Web Server / PS / DB various timeout issues without using "wait forever" settings that can then affect other Apps.  Food for thought.  ;-)

Regards .. Chris

Comment
  1. Pere Mascaró
  2. Tuesday, 12 November 2024 15:56 PM UTC
Yes, it’s something I hadn’t thought of. It would be a good option for me.

Thank you.
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Tuesday, 12 November 2024 12:03 PM UTC
  2. PowerServer
  3. # 2

Hi

Are you sure that your application is not leaving open uncommitted transactions and that the timeout you are experiencing is a transaction timeout?

One of the App we converted was doing that, it was reading data and that opened a transaction (DB did not have autocommit). We had to commit after retrieving data to fix that time out.

Regards

David

Comment
  1. Pere Mascaró
  2. Tuesday, 12 November 2024 15:57 PM UTC
Hi David,

Thank you for your response. The database does not have autocommit. It’s possible that this is the issue then. I will try it and confirm if it solves the problem. Thanks again.
  1. Helpful
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.