Board index » delphi » computer connection count (not user connection count)

computer connection count (not user connection count)

I've a program wich access a GDB database. This program loads DLL's who also
access the same GDB.

I'm trying to share the main program access to the GDB, but without success.

For achieving some tasks (garbage collection), I must know how many programs
are connected to the database. How can I know this number as a user may have
2 connections opens (when a dll is accessing the DB) and other may have 1
(no DLL loaded).

Thanks
Also if somebody can tell me how to share the program database connection,
that would be great.

BOB

 

Re:computer connection count (not user connection count)


Quote
Bob Bedford wrote:
> For achieving some tasks (garbage collection), I must know how many
> programs are connected to the database. How can I know this number as
> a user may have 2 connections opens (when a dll is accessing the DB)
> and other may have 1 (no DLL loaded).

        Count the number of distinct usernames in TIBDatabaseInfo.UserNames.

        -Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
  Delphi/InterBase Weblog : http://delphi.weblogs.com
How to ask questions the smart way:
  http://www.catb.org/~esr/faqs/smart-questions.html

Re:computer connection count (not user connection count)


The problem is that every program access my DB with the same useraccount. (I
don't manage users connection)

"Craig Stuntz [TeamB]" <cstu...@vertexsoftware.com> a crit dans le message
de news:3ed4acb7@newsgroups.borland.com...

Quote
> Bob Bedford wrote:

> > For achieving some tasks (garbage collection), I must know how many
> > programs are connected to the database. How can I know this number as
> > a user may have 2 connections opens (when a dll is accessing the DB)
> > and other may have 1 (no DLL loaded).

> Count the number of distinct usernames in TIBDatabaseInfo.UserNames.

> -Craig

> --
> Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
>   Delphi/InterBase Weblog : http://delphi.weblogs.com
> How to ask questions the smart way:
>   http://www.catb.org/~esr/faqs/smart-questions.html

Re:computer connection count (not user connection count)


Quote
Bob Bedford wrote:
> The problem is that every program access my DB with the same
> useraccount. (I don't manage users connection)

        With IB 7 you can count workstations / IP addresses in
TMP$ATTACHMENTS.  

        -Craig

Re:computer connection count (not user connection count)


Hi Craig,

I've been able to share the database connection between my main program and
the DLL's, so only one connection is now created by the program.

Thanks anyway for your help.

"Craig Stuntz [TeamB]" <cstu...@vertexsoftware.com> a crit dans le message
de news:3ed4b938@newsgroups.borland.com...

Quote
> Bob Bedford wrote:

> > The problem is that every program access my DB with the same
> > useraccount. (I don't manage users connection)

> With IB 7 you can count workstations / IP addresses in
> TMP$ATTACHMENTS.

> -Craig

Re:computer connection count (not user connection count)


Quote
> I've been able to share the database connection between my main program
and
> the DLL's, so only one connection is now created by the program.

Hi Bob,

It would be interesting to hear how you could manage to share a main
programs's connection in a DLL. Would you mind to tell the mechanism? (other
than passing the DB handle to the DLL routine)

Regards,

Dr.Cem

Re:computer connection count (not user connection count)


Hi Cem,

Quote
> It would be interesting to hear how you could manage to share a main
> programs's connection in a DLL. Would you mind to tell the mechanism?
(other
> than passing the DB handle to the DLL routine)

Sorry, but I passed the DB handle to the DLL's. That's the only way I've
found to share the DB connection, and thinking on an other way, I don't
think it would be possible otherwise.

Regards.

Re:computer connection count (not user connection count)


Hi Bob,

Thank you for the info, though I was hoping otherwise.

Dr.Cem

Re:computer connection count (not user connection count)


Quote
Cem Karacaoplu wrote:
> It would be interesting to hear how you could manage to share a main
> programs's connection in a DLL. Would you mind to tell the mechanism?
> (other than passing the DB handle to the DLL routine)

        The other way is to build both the DLL and the calling EXE with
runtime packages -- then you can pass a TIBDatabase (or whatever)
reference.

        -Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
  Delphi/InterBase Weblog : http://delphi.weblogs.com
Please read and follow Borland's rules for the user of their
  news server: http://info.borland.com/newsgroups/guide.html

Other Threads