Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 13 of 13 total
Thread 1107 errors. "The session ID XX is no ...."
Sat, Aug 9 2025 2:28 PMPermanent Link

Terry Swiers

Hi Ian,

> Where/how do you integrate this code into the App please?   My first thought is in the OnRemoteTimeout event of the TEDBSession.

The OnRemoteTimeout isn't going to work as that handles a different condition, not missing sessions.

Here is the general list of what you need to figure out how to do in your program.

1. Create a thread class that receives a TEDBSession pointer, which gets saved off in the class for use later.
2. Configure the thread to run at idle priority.
3. Create a loop in the thread execute function that loops until the thread is terminated and sleeps for a second or so on each loop so you don't starve the other threads.
4. Keep track of the elapsed time and call call the ClearSessionNotFound from within Synchronize at the time duration of your choosing.  5 minutes is probably your best bet.
5. Reset the time duration count and repeat as necessary.
6. If you use dynamically created session objects, make sure that you wrap everything in an exception block and/or check to make sure that the session object still exists when it's called from the background thread.

My integration is part of a larger highly specific scheduled background thread class hierarchy and relies on some high resolution timers, so it's not just something that I can throw up here.
Sat, Aug 9 2025 2:52 PMPermanent Link

Ian Branch

Avatar

Ahhh.  Tks Terry.  Threads are no my favourite subject. Frown
Will have a bash at it.

Ian
Sat, Aug 9 2025 5:04 PMPermanent Link

Terry Swiers

> Threads are no my favourite subject.

Mine either.  I just spent the last couple of months tracking down a threading issue with form creation and destruction timing.  

You may want to keep track of how long it's been between user activity events so you only fire it if the user is not actively using your app.  Also check to see if you can lock the session manager before getting the server time
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image