Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 4 of 4 total |
Handling lost sessions |
Thu, Aug 13 2015 5:46 PM | Permanent Link |
Jeff Cook Aspect Systems Ltd | Hi
I'm having problems with lost sessions when my app is left alone doing nothing. User returns to PC and it has been disconnected. I followed the suggestions per this thread http://www.elevatesoft.com/forums?action=view&category=edb&id=edb_general&page=1&msg=15738#15738 but still have a problem. This bit of code (picked out of Tim's posts) procedure TmainForm.AppException(Sender: TObject; E: Exception); begin if Assigned(E) then if (E is EDatabaseError) and (E is EEDBError) then begin if EEDBError(E).ErrorCode = EDB_ERROR_SESSIONNOTFOUND then begin bSessionGone := True; ShowMessage('lost session'); apmDM.EDBSession.Connected := False; apmDM.EDBSession.Connected := True; end; end; end; .... works OK and I see the 'lost session' message. The message was inserted to prove that the error wasn't being caught elsewhere. BUT disconnecting the session and reconnecting obviously closes all the tables and queries and leaves the screen full of blank grids and edits. It can happen on a modal screen that validates the data, stopping exit until all is correct - which with no data is impossible so crashing the app is the only option. Has anyone found a graceful way of clearing this problem. I could just put out a message "silly boy, your computer got lonely and has gone away to sulk" and just Terminate. It would be nice to be able to get back to where the user was - same screen, same row of the table/query. Can't see a way doing that Am I missing something obvious? Cheers Jeff |
Fri, Aug 14 2015 5:26 AM | Permanent Link |
Fernando Dias Team Elevate | Jeff,
Do you have the TEDBSession.RemotePing set to True, and the TEDBSession.PingInterval set to some reasonable value, like 60 seconds for example? Please check that out. -- Fernando Dias [Team Elevate] Ąs 22:46 de 13/08/2015, Jeff Cook escreveu: > Hi > > I'm having problems with lost sessions when my app is left alone doing nothing. User returns to PC and it has been disconnected. > > I followed the suggestions per this thread > > http://www.elevatesoft.com/forums?action=view&category=edb&id=edb_general&page=1&msg=15738#15738 > > but still have a problem. This bit of code (picked out of Tim's posts) > > procedure TmainForm.AppException(Sender: TObject; E: Exception); > begin > if Assigned(E) then > if (E is EDatabaseError) and (E is EEDBError) then > begin > if EEDBError(E).ErrorCode = EDB_ERROR_SESSIONNOTFOUND then > begin > bSessionGone := True; > ShowMessage('lost session'); > apmDM.EDBSession.Connected := False; > apmDM.EDBSession.Connected := True; > end; > end; > end; > > .... works OK and I see the 'lost session' message. The message was inserted to prove that the error wasn't being caught elsewhere. > > BUT disconnecting the session and reconnecting obviously closes all the tables and queries and leaves the screen full of blank grids and edits. > > It can happen on a modal screen that validates the data, stopping exit until all is correct - which with no data is impossible so crashing the app is the only option. > > Has anyone found a graceful way of clearing this problem. I could just put out a message "silly boy, your computer got lonely and has gone away to sulk" and just Terminate. > > It would be nice to be able to get back to where the user was - same screen, same row of the table/query. > > Can't see a way doing that Am I missing something obvious? > > Cheers > > Jeff |
Fri, Aug 14 2015 5:28 AM | Permanent Link |
Fernando Dias Team Elevate | ....
Sorry, it should be TEDBSession.RemotePingInterval instead of TEDBSession.PingInterval. -- Fernando Dias [Team Elevate] |
Fri, Aug 14 2015 12:04 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Jeff,
<< I'm having problems with lost sessions when my app is left alone doing nothing. User returns to PC and it has been disconnected. >> In addition to Fernando's suggestion, is the PC in question using a wireless adapter, or a network adapter that may "go to sleep" due to power settings ? Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, May 7, 2024 at 06:25 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |