Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Active sessions on the Server question.
Fri, Oct 6 2006 1:50 AMPermanent Link

"Ian Branch"
Hi Guys,

   I want to test the number of allowed sessions for the database and the current
number of active sessions so I can prevent any attempt to log into the
server/database if the allowed number of sessions is exceeded.

   I figure it should work something like the following but I get an exception at
the first line.
========================================================================

     IF GetRemoteConnectedSessionCount <= GetRemoteSessionCount THEN BEGIN
       Screen.Cursor := crDefault;

       MsgBox.Buttons := [mbOK];
       MsgBox.DlgType := mtError;
       MsgBox.Message.Add('The maximum allowed number of connected users has
been reached.');
       MsgBox.Message.Add('The application is not permitted to continue and
log in.');
       MsgBox.Message.Add('The application will now be closed.');
       MsgBox.Execute;
       lCloseFlag := True;
       Exit;
     END
     ELSE BEGIN

       DBSession.Active := True;
   ....
   ....
========================================================================
   What have I missed?

Regards & TIA,

Ian


--
Fri, Oct 6 2006 1:52 AMPermanent Link

"Ian Branch"
I should have mentioned I am trying to do this in the Client.
Fri, Oct 6 2006 7:38 AMPermanent Link

"Frans van Daalen"

"Ian Branch" <branch@sitathome.net> wrote in message
news:0D5E5FEF-AA13-46A4-BA73-C64A30A8EE6C@news.elevatesoft.com...
> Hi Guys,
>
> I want to test the number of allowed sessions for the database and the
> current
> number of active sessions so I can prevent any attempt to log into the
> server/database if the allowed number of sessions is exceeded.
>
> I figure it should work something like the following but I get an
> exception at
> the first line.
> ========================================================================
>
>      IF GetRemoteConnectedSessionCount <= GetRemoteSessionCount THEN BEGIN
>        Screen.Cursor := crDefault;
>
>        MsgBox.Buttons := [mbOK];
>        MsgBox.DlgType := mtError;
>        MsgBox.Message.Add('The maximum allowed number of connected users
> has
> been reached.');
>        MsgBox.Message.Add('The application is not permitted to continue
> and
> log in.');
>        MsgBox.Message.Add('The application will now be closed.');
>        MsgBox.Execute;
>        lCloseFlag := True;
>        Exit;
>      END
>      ELSE BEGIN
>
>        DBSession.Active := True;
> ....
> ....
> ========================================================================
> What have I missed?
>

Did you use session.GetRemoteSessionCount ?
Also please be aware that you are counting sessions and that is not the same
as connected users

Frans


Fri, Oct 6 2006 4:03 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ian,

<< I want to test the number of allowed sessions for the database and the
current number of active sessions so I can prevent any attempt to log into
the server/database if the allowed number of sessions is exceeded.

I figure it should work something like the following but I get an exception
at the first line. >>

What exception are you getting ?

Also, the GetRemoteSessionCount is simply a total count of the number of
sessions on the database server, regardless of whether they are connected or
not.  It is not a setting in the database server configuration.  The same is
true for the GetRemoteConnectedSessionCount, which is the same but only
shows the count of the sessions that are actually connected.  If you want to
control the number of sessions permitted on the database server, then use
this property:

http://www.elevatesoft.com/dbisam4d5_tdbisamengine_serverlicensedconnections.htm

Note that you'll have to recompile the database server (dbsrvr.dpr) to have
it take effect.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Oct 6 2006 8:45 PMPermanent Link

"Ian Branch"
Tim Young [Elevate Software] wrote:

> If you want to
> control the number of sessions permitted on the database server, then use
> this property:
>
> http://www.elevatesoft.com/dbisam4d5_tdbisamengine_serverlicensedconnections.h
> tm
>
> Note that you'll have to recompile the database server (dbsrvr.dpr) to have
> it take effect.

Hi Tim,

   Managed to get that far.  The problem is that i want to be able to issue the
Server in a 4 Session configuration and then the Customer would pay on a per
session basis for additional sessions.  Ergo I would need to be able to
increment the ServerLicensedConnections 'remotely'.

   If I put a test for the authorised # of connections, based on data in an
encrypted configuration file, in the Server Startup event and set the
ServerLicensedConnections accordingly that should do it.  Yes/No?

Regards,

Ian


--
Mon, Oct 9 2006 1:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ian,

<< If I put a test for the authorised # of connections, based on data in an
encrypted configuration file, in the Server Startup event and set the
ServerLicensedConnections accordingly that should do it.  Yes/No? >>

Yes, but you'll have to do so before the startup event - it has to be done
while the TDBISAMEngine component is inactive.  The main form's FormCreate
event handler should do the trick.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image