Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Handling lost sessions
Thu, Aug 13 2015 5:46 PMPermanent Link

Jeff Cook

Aspect Systems Ltd

Avatar

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 AMPermanent Link

Fernando Dias

Team Elevate 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 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

....
Sorry, it should be TEDBSession.RemotePingInterval instead of TEDBSession.PingInterval.

--
Fernando Dias
[Team Elevate]
Fri, Aug 14 2015 12:04 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email 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
Image