Subject Re: [firebird-support] embedded twice
Author The Wogster
Bogusław Brandys wrote:
> Nando Dessena wrote:
>> Elmar,
>> I am replying here because for some reason I don't see the message you
>> replied to.
>>
>>>> I even discover that if firebird embedded would optionally create only
>>>> *one* superserver instance on the first loading into memory - it will be
>>>> a new feature ;)
>> adding the TCP server code to fbembed, together with an API to start
>> and stop listening would be enough. Then one application in the group will
>> host the server & database engine for the others to use. Me and others
>> have been asking for this supposedly trivial feature many times in the
>> past, but the general objection has always been along the lines of:
>
> Nice.Could it be however even simpler.For example just a mutex check
> inside fbembed.dll on first DLL loading and one function to set this
> mode and mutex name ? Second ,third and other fbembed.dll load call will
> function (in this mode) just like a local client code only.
> Only the first fbembed.dll load will create superserver embedded engine.
>
> This is just an idea - I'm not going to force it or even not much care
> if somebody doesn't likes it.
>

Typically, if two applications install themselves as embedded, then they
are going to use completely independent databases as well. So perhaps
the point is a moot one. Two independent applications using the
embedded server in a day when most workstations sold have 2+ GHz
processors and 1 GB of ram, is really not something to be concerned with.

Having two applications using embedded to access a single database, is a
case of using the wrong tool for the job. In that case, a full server
should be installed, and all applications should use the regular client,
which is what it's designed for.

A software installer, before considering using embedded, should check
for a server*, if a server exists, then it checks for an existing
client, if it finds one, it's done, and sets up to use the existing
server and client. If there is a server, but no client, then install a
client. Only when there is NO server, should an application consider
using embedded.

W




* Easiest way to check, is to ask the user if a Firebird server is
available, with the note to answer NO if not sure. If you know that a
server is available, you will know how to add the database to the
server, and what user names and passwords to use to do so.