Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Handling Connection Time Out

When Connecting to SQL Anywhere via ODBC a client application can get disconnected from the server either by the LiveNess Timeout (where a regular check run by the connection determined that communication has dropped) or by the Idle Timeout where a certain amount of time has passed with no activity between the client and the server.  As I understand it, parameters which control the default Idle or Liveness test periods can be configured with Server Parameters -ti (idle) and -tl (liveness).  These can also be overridden by the ODBC Client connection parameters.

One could try to ensure that disconnection doesn't always happen on idle or liveness timeout - not always a best practice

The question is how to best determine if an idle application has lost its connection so the user does not try to run a SQL or Datawindow Query and have the application error.

Some years ago I saw samples where a SQL query was run on an idle timer - then checking the DB Return Code and then use Disconnect and Connect to reestablish the connection. 

Is this still the best practice or have their been enhancements in the PB environment (like connection error events) that can simplify this handling.

Can anyone post some good sample code?


Former Member
Not what you were looking for? View more on this topic or Ask a question