Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 11 to 20 of 22 total |
Disconnecting Users in Remote Sessions. |
Fri, Apr 23 2010 11:57 AM | Permanent Link |
Uli Becker | Steve,
> I need to handle that too at some stage so I'd be interested in what you come up with. Sure, I'll keep you informed. Uli |
Fri, Apr 23 2010 12:02 PM | Permanent Link |
Uli Becker | John,
> I guess the main problem is that anything "data dependent" in the > application becomes invalid in this situation. After trying the automatic > reconnect (in DBISAM admittedly) I found it was easier and more consistent > to restart the application. Right. Though a restart only makes sense if the connection can be established. And another problem occurs if the application allows just one instance. But that should be resolvable. Uli |
Fri, Apr 23 2010 12:26 PM | Permanent Link |
John Hay | Uli
> Though a restart only makes sense if the connection can be established. That's true. I use this kind of process on unattended "kiosk type" applications. If a connection is not established at start up it shows an appropriate display and just keeps retrying. > And another problem occurs if the application allows just one instance. Good point. If one uses mutexes it would definitely need some kind of sleep/retry to allow it to load. John |
Fri, Apr 23 2010 4:25 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Uli,
<< The reason of my question is, that I am looking for a way to react to a disconnection. We talked about that in another thread. My idea is like that: 1. The application is disconnected 2. The application tries to reconnect and to reopen all tables and queries that were opened before. 3. After a timeout it shuts down. Sounds easy, seems to be difficult. >> Do you want to deal with a situation where the remote session is *removed* from the ElevateDB Server, or a situation where the remote session has simply been disconnected ? The latter situation (disconnect) is simple - just make sure that a TEDBSession.OnRemoteReconnect event handler is defined, and then make sure to set the Continue parameter to True. http://www.elevatesoft.com/manual?action=viewevent&id=edb2&product=d&version=7&comp=TEDBSession&event=OnRemoteReconnect -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Apr 23 2010 4:34 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Uli,
<< That's what I am doing now. I am using the OnRemoteReconnect event: >> I should read ahead in these threads. << Both. In my case I have remote connections to some networks of my clients. There are different applications (EDB-based) running on a number of workstations there. Some of them are running unattended. In order to exchange EDBServer e.g. I have to disconnect all sessions, install the server and restart it. >> Okay, so the sessions are being removed, not disconnected. In that case: 1) Keep using the OnRemoteReconnect event, but set Continue to True, not False like you're currently doing. You basically want your application to always try to reconnect to the ElevateDB Server at this point (see below 3) for more modifications necessary). 2) Define a TApplication.OnException handler in your application, and trap for error code #1107 (session ID XXX no longer exists on the server). When you see this error code, set a global Boolean variable to indicate that the session is gone and set the remote TEDBSession.Connected property to False. 3) Modify your OnRemoteReconnect event handler to look at the global variable that indicates that the session is gone. If it sees this variable is True, then set Continue to False and StopAsking to True. If it sees this variable as False, then set Continue to True. 4) Be sure to set the global variable to False in an TEDBSession.AfterConnect event handler for your session: http://www.elevatesoft.com/manual?action=viewevent&id=edb2&product=d&version=7&comp=TEDBSession&event=AfterConnect That should do it. -- Tim Young Elevate Software www.elevatesoft.com |
Mon, Apr 26 2010 1:17 PM | Permanent Link |
Uli Becker | Tim ,
> Do you want to deal with a situation where the remote session is > *removed* from the ElevateDB Server, or a situation where the remote > session has simply been disconnected ? I want to handle both situations, but my question referred to *removed*. Uli |
Mon, Apr 26 2010 1:18 PM | Permanent Link |
Uli Becker | Tim
> Okay, so the sessions are being removed, not disconnected. > > In that case: .... > That should do it. Thanks a lot for this detailed explanation. I'll try it exactly like this. Uli |
Mon, May 3 2010 8:15 AM | Permanent Link |
gripsware gripsware datentechnik gmbh | Hello Tim,
I tried exactly your way to handle the lost remote session, but in my application is the application.OnException event not fired?!?!? So I´m not able to set my global boolean variable to True I can not find - why? Do you have any idea? best regards Michael "Tim Young [Elevate Software]" wrote: Uli, << That's what I am doing now. I am using the OnRemoteReconnect event: >> I should read ahead in these threads. << Both. In my case I have remote connections to some networks of my clients. There are different applications (EDB-based) running on a number of workstations there. Some of them are running unattended. In order to exchange EDBServer e.g. I have to disconnect all sessions, install the server and restart it. >> Okay, so the sessions are being removed, not disconnected. In that case: 1) Keep using the OnRemoteReconnect event, but set Continue to True, not False like you're currently doing. You basically want your application to always try to reconnect to the ElevateDB Server at this point (see below 3) for more modifications necessary). 2) Define a TApplication.OnException handler in your application, and trap for error code #1107 (session ID XXX no longer exists on the server). When you see this error code, set a global Boolean variable to indicate that the session is gone and set the remote TEDBSession.Connected property to False. 3) Modify your OnRemoteReconnect event handler to look at the global variable that indicates that the session is gone. If it sees this variable is True, then set Continue to False and StopAsking to True. If it sees this variable as False, then set Continue to True. 4) Be sure to set the global variable to False in an TEDBSession.AfterConnect event handler for your session: http://www.elevatesoft.com/manual?action=viewevent&id=edb2&product=d&version=7&comp=TEDBSession&event=AfterConnect That should do it. -- Tim Young Elevate Software www.elevatesoft.com |
Mon, May 3 2010 1:47 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Michael,
<< I tried exactly your way to handle the lost remote session, but in my application is the application.OnException event not fired?!?!? So I´m not able to set my global boolean variable to True I can not find - why? Do you have any idea? >> When you run it in the debugger, is the exception raised ? If so, then trace it through and see if you're trapping the exception earlier in the call stack. -- Tim Young Elevate Software www.elevatesoft.com |
Mon, Apr 8 2013 2:32 PM | Permanent Link |
Barry | <<Okay, so the sessions are being removed, not disconnected.
In that case: 1) Keep using the OnRemoteReconnect event, but set Continue to True, not False like you're currently doing. You basically want your application to always try to reconnect to the ElevateDB Server at this point (see below 3) for more modifications necessary). 2) Define a TApplication.OnException handler in your application, and trap for error code #1107 (session ID XXX no longer exists on the server). When you see this error code, set a global Boolean variable to indicate that the session is gone and set the remote TEDBSession.Connected property to False. 3) Modify your OnRemoteReconnect event handler to look at the global variable that indicates that the session is gone. If it sees this variable is True, then set Continue to False and StopAsking to True. If it sees this variable as False, then set Continue to True. 4) Be sure to set the global variable to False in an TEDBSession.AfterConnect event handler for your session: http://www.elevatesoft.com/manual?action=viewevent&id=edb2&product=d&version=7&comp=TEDBSession&event=AfterConnect That should do it. >> Tim, When I am in the debugger too long the session is being removed. So I thought I'd implement your suggestions and although the code does get executed, the session isn't being restarted. I know I can increase the server timeout, but I'd like to see this code working in case the client has a similar problem. I must be missing something obvious in my code (see below), and I'm wondering if you (or someone else) can look it over. BTW, TdmMain is the Datamodule. For instance, shouldn't the code be setting MySession.Connected := true; someplace so it creates the new session? After all, if the old session was lost on the server, don't I have to create a new session? TIA Barry procedure TdmMain.cwSessionAfterConnect(Sender: TObject); begin SessionGone := false; end; procedure TdmMain.cwSessionRemoteReconnect(Sender: TObject; var Continue, StopAsking: Boolean); begin if SessionGone then begin Continue := false; StopAsking := true; end else begin Continue := true; end; end; procedure TdmMain.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 SessionGone := true; MySession.Connected := false; end; end; end; procedure TdmMain.DataModuleCreate(Sender: TObject); begin SessionGone := false; Forms.Application.OnException := AppException; end; |
« Previous Page | Page 2 of 3 | Next Page » |
Jump to Page: 1 2 3 |
This web page was last updated on Wednesday, June 12, 2024 at 01:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |