Subject Re: [ib-support] Working with IB from an application running several times in Terminal Server
Author Paul Schmidt
On 29 Jan 2002, at 21:45, Luciano Sparacino wrote:

> in this case each instance of the application connects with the same
> user name, so could the server take all connections as a single one?

I think your attributing a lot more intellegence to the server then
what is there. Your talking about connection pooling, and that is a
very complex beast, that neither the server nor client library
(gds32.dll or gds32.so) get into. I doubt that Firebird ever will,
because your not paying for it based on the connection count, so
you don't care whether it's using 1 or 1,000,000,000. In the case of
Interbase, Borland doesn't sell enough, to put the programmer time
into building connection pooling code. It would be cheaper to just
allow more connections, for the same money.

What you need to be careful of, is that your program isn't somehow
sharing the connection. There are three components of a
client/server communication. There is the connection, there is the
transaction, and there is the statement, the relationship between
them is many to many. Now typically when you run a program you
establish a connection, associate with it a transaction, and then
associate with that one or more statements. However you could
also establish more then one connection, and some software does.
For example if an application is multi-threaded, then it's well
advised that each thread establish it's own connection, to keep
them from tripping over one another.

You need to make sure, that each instance is establishing it's own
connection, and that each instance is properly committing all
transactions it establishes, and that it actually drops the
connection before it quits. Don't count on the end of the execution
properly disconnecting the database, if there is a disconnect
command use it.

Paul

Paul Schmidt
Tricat Technologies
paul@...
www.tricattechnologies.com