Subject Re: [firebird-support] Utilities link libfbembed.so on Linux CS. How does they access to remote database ?
Author KIMURA, Meiji
Hi Helen,

Thank you for your reply. I learned a lot from it.

--- Helen Borrie <helebor@...> wrote:

> At 10:36 AM 30/08/2007, Meiji wrote:
> >I am a newbie for FB Linux CS. I used 'ldd' command on Linux and
> >it says FB utilities link libfbembed.so. For example gbak (on FB 1.5.4)
> >
> >ldd gbak
> >linux-gate.so.1 => (0x005e9000)
> >libfbembed.so.1 => /usr/lib/libfbembed.so.1 (0x00110000)
> >:
> >
> >I understand the gbak use libfbembed.so under local database access.
>
> Yes, when you access a database locally with the Classic server, the
> "client" part of libfbembed.so accesses the database directly (as a
> file) by way of the server that is embedded in the library, i.e., it
> does not work through an instance of the fb_inet_server executable,
> as remote clients do.
In that time, FB can do exclusive operation properly ? for example,

(1) gbak with libfbembed.so vs. isql with libfbembed.so
(2) gbak with libfbembed.so vs. user application with libfbembed.so
(3) gbak with libfbembed.so vs. user application with libfbclient.so

Especially, User application don't use the same way like a gbak,
If user use user application in the same PC with server, he(or she) have to link
libfbembed.so in order to gain the good performance.

And there is any possibility to use user application via network, he(or she)
have to link libfbclient.so.

Is it correct recognition ?

> So - when an instance of gbak wants to access a database locally, it
> uses libfbembed.so.
>
> >But we use gbak in order to access a remote database via network.
> >In that case, how does gbak access to it ?
>
> In that case, the gbak client at your calling machine is only passing
> a request to the Service Manager code at the remote server. The
> remote Service Manager will make the actual connection and execute
> the backup, using code that is embedded in the engine. (The code
> that the Service Manager executes is the same code that is deployed
> in the gbak executable.)
>
> >libfbembed.so have a capability of accessing to remote database ? or
> >gbak load libfbclient.so dynamically and use it ?
>
> You *can* make a local loopback connection using libfbembed.so, in
> which case the direct connection to the embedded server code is not
> used, but instead a fb_inet_server process will be created by xinetd.
>
> Theoretically, the client part of libfbembed.so should be able to do
> a connection to a remote server, provided of course that the local
> Linux user has the required permissions to create the remote backup
> file. I remember that it didn't work in the past and you needed to
> extract libfbclient.so and the "remotable" versions of the utilities
> from the SS tarball...maybe this has changed with more recent
> distributions - why not try it out?
>
> ./heLen

Regards,
KIMURA, Meiji(FAMILY, Given)
Tokyo, JAPAN