Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 22 total
Thread Disconnecting Users in Remote Sessions.
Mon, Apr 19 2010 6:59 PMPermanent Link

Steve Gill

Avatar

If I have a number of users connected to the database (via Remote sessions) and I want to perform an operation that requires exclusive access (eg. a repair), how do I disconnect them?  Do I iterate through all of the active sessions and drop them one-by-one in SQL using " DISCONNECT SERVER SESSION"?

Regards,

Steve
Tue, Apr 20 2010 7:51 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< If I have a number of users connected to the database (via Remote
sessions) and I want to perform an operation that requires exclusive access
(eg. a repair), how do I disconnect them?  Do I iterate through all of the
active sessions and drop them one-by-one in SQL using " DISCONNECT SERVER
SESSION"? >>

You would need to use REMOVE SERVER SESSION, but yes, that is how you would
do it.

--
Tim Young
Elevate Software
www.elevatesoft.com
Tue, Apr 20 2010 6:16 PMPermanent Link

Steve Gill

Avatar

Hi Tim,

<< You would need to use REMOVE SERVER SESSION, but yes, that is how you would
do it.>>

Thanks.  I wrote a stored procedure to do it and it seems to work perfectly.

Regards,

Steve
Wed, Apr 21 2010 3:54 AMPermanent Link

Uli Becker

Steve,

> Thanks.  I wrote a stored procedure to do it and it seems to work perfectly.

Just out of interest. How do your applications react when they are
disconnected from the server?

Uli
Wed, Apr 21 2010 1:52 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Just out of interest. How do your applications react when they are
disconnected from the server? >>

They're probably not happy about it. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Apr 21 2010 3:45 PMPermanent Link

Uli Becker

Tim,

> They're probably not happy about it. Smiley

I think so. Smile

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.

Uli
Wed, Apr 21 2010 5:54 PMPermanent Link

Steve Gill

Avatar

Hi 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.  >>

Actually I haven't got to that part yet.  The plan is to display a message to the user when it occurs and then hopefully close the application gracefully - maybe.  Not the best solution but the problem is, with some sites having over 100 users spread over a wide area, it's not practical for the administrator to go around and tell everyone to log out.  There's also the problem of people still being logged in and not at their desks (and their workstations are locked).

What I would really like to do is use the yet-to-be-released messaging layer (hint, hint, Tim <vbg>) to send out a message to all applications to shut themselves down in 5 minutes or whatever.

Another idea I thought of is to have a special table that has just one record with a flag field, eg. Shutdown = True. The application could periodically check this field and when it switches from False to True for example, display a message to the user that it's closing time and no more drinks will be served, then shut itself down.

But this is different than what you need.  I think you're looking for a way to handle non-planned disconnections rather than forced ones.

Steve
Thu, Apr 22 2010 1:19 PMPermanent Link

Uli Becker

Steve,

<< The plan is to display a message to the user when it occurs and then
hopefully close the application gracefully - maybe.  >>

That's what I am doing now. I am using the OnRemoteReconnect event:

  Application.MessageBox(MyMessage),'',16);
  Continue := false;
  StopAsking := true;
  Mainform.close;


<< it's not practical for the administrator to go around and tell
everyone to log out. >>

True. Smile

<< Another idea I thought of is to have a special table that has just
one record with a flag field, eg. Shutdown = True...>>

Interesting approach.

<<I think you're looking for a way to handle non-planned disconnections
rather than forced ones.>>

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.

At the end I have to restart all these applications on each workstation.
Not that funny. Smile

So I am looking for a possibility of an automatic reconnection during a
certain time frame.

Uli
Thu, Apr 22 2010 6:12 PMPermanent Link

Steve Gill

Avatar

Hi Uli,

<<At the end I have to restart all these applications on each workstation.
Not that funny. Smile

So I am looking for a possibility of an automatic reconnection during a
certain time frame.>>

I need to handle that too at some stage so I'd be interested in what you come up with.

Steve
Fri, Apr 23 2010 5:38 AMPermanent Link

John Hay

Uli

> At the end I have to restart all these applications on each workstation.
> Not that funny. Smile
>
> So I am looking for a possibility of an automatic reconnection during a
> certain time frame.

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.  You can do this as part of your app eg

procedure restart;

var
 handle:thandle;
 appnameTonguehar;

begin
 appname := pchar(application.exename);
 shellexecute(handle,apname,nil,nil,sw_shownormal);
 application.terminate;
end;

John

Page 1 of 3Next Page »
Jump to Page:  1 2 3
Image