Default dll

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Galdarius
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 23.07.2006, 19:21
Contact:

Default dll

Post by Galdarius »

on firebird connection, why not load library in this order?:
fbembeded
fbclient
gds32
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi for most current builds (at my site) and SVN fbembedded and fbclient can be used simultaneously, just by using the right protocol. Just have a look in the code for the right library names. I did not write it myself, so I don't know why the author used an other name for fbembedded (I think just for analogy with mysql implementation). I think the failover for embedded is the normal client as you propose.
About gds32 : does that file provide the same functionality as the fbxxx files? I was thinking it's rather old. Do you know what firebird versions use that name?

Mark
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post by gto »

Hello!
The DLL loading is defined as fallows:


ZPlainInterbase5.pas and ZPlainInterbase6.pas:

const
WINDOWS_DLL_LOCATION = 'gds32.dll';
LINUX_DLL_LOCATION = 'libgds.so';

ZPlainFirebird10.pas:

const
WINDOWS_DLL_LOCATION = 'gds32.dll';
LINUX_DLL_LOCATION = 'libgds32.so';
LINUX_IB_CRYPT_LOCATION = 'libcrypt.so';

ZPlainFirebird15.pas

const
WINDOWS1_DLL_LOCATION = 'fbclient15.dll';
WINDOWS1_DLL_LOCATION_EMBEDDED = 'fbclientd15.dll';
LINUX1_DLL_LOCATION = 'libfbclient.so.15';
LINUX1_IB_CRYPT_LOCATION = 'libcrypt.so.15';
LINUX1_DLL_LOCATION_EMBEDDED = 'libfbembed.so.15';

ZPlainFirebird20.pas

const
WINDOWS1_DLL_LOCATION = 'fbclient20.dll';
WINDOWS1_DLL_LOCATION_EMBEDDED = 'fbclientd20.dll';
LINUX1_DLL_LOCATION = 'libfbclient.so.20';
LINUX1_DLL_LOCATION_EMBEDDED = 'libfbembed.so.20';
LINUX1_IB_CRYPT_LOCATION = 'libcrypt.so.20';

About the loading, the exactly DLL is choosen according to protocol type, as mdaems said.
GDS32 and FBCLIENT are different files, where FBCLIENT is compatible with GDS32 and nothing more.
The firebird installer ask if you want to generate a copy of FBCLIENT as GDS32 to grant backwards compatibility, as any program looking for GDS32 can transparently load FBCLIENT and use it. Reverse situation may work, but is not intended to.
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
Galdarius
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 23.07.2006, 19:21
Contact:

humn...

Post by Galdarius »

i need make this change and compile zeos?

ZPlainFirebird15.pas

const
WINDOWS1_DLL_LOCATION = 'fbclient15.dll';
WINDOWS1_DLL_LOCATION_EMBEDDED = 'fbclientd15.dll';
LINUX1_DLL_LOCATION = 'libfbclient.so.15';
LINUX1_IB_CRYPT_LOCATION = 'libcrypt.so.15';
LINUX1_DLL_LOCATION_EMBEDDED = 'libfbembed.so.15';

VLW
this is a Signature
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post by gto »

Hello Galdarius !

The DLL that will be loaded depends on which protocol you selected! There's no "try" to load one or other, just a try to load the exactly DLL that matchs your protocol. If you want to do something like check for DLLs and the configure the protocol, and understand the differences between all versions, you may use something like this:

Code: Select all

if FileExists('DLL_for_first_protocol.dll') then
   ZConnection.protocol := 'My_First_protocol'
else if FileExists('DLL_for_second_protocol.dll') then
   ZConnection.protocol := 'My_Second_protocol'
else if FileExists('DLL_for_third_protocol.dll') then
   ZConnection.protocol := 'My_third_protocol'
else
   showmessage('None of supported protocols DLL find in path');
In Portguese:

Cara, a DLL que o zeos carrega depende do protocolo que tu seleciona. Tipo, ele não testa várias DLLs em busca de uma certa, cada protocolo tem a DLL específica e ele vai carregar ela sempre. O que tu pode fazer pra "procurar" pela DLL certa é um lance como tem aí em cima, uma fila de if then else e com a função FileExists, pra verificar se o arquivo existe e está acessível ao programa. Só cuide com as versões, firebird é um tanto diferente do interbase e ainda deve ser diferente do firebird embeded.

Abraços!
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
Galdarius
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 23.07.2006, 19:21
Contact:

Post by Galdarius »

da uma olhada nesse pas q ta anexado.
se estiver certo, o zeos poderia ser distribuido assim, conheço muita gente q não o usa por cauza desse problema, não conseguiu usar o firebird embarcado e usa só a gds.
o zeos seria muito mais aceito
You do not have the required permissions to view the files attached to this post.
this is a Signature
Galdarius
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 23.07.2006, 19:21
Contact:

yessssssssssssssssssssssssssssssssssssssssssssssss

Post by Galdarius »

Work Great!!!!!!!!!!!!!!!!!!!!

see this..

lets deploy to all!!!
this is a Signature
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Can somebody tell us what this is all about? I understand it's easier four you to communicate in you own languages, but can you doit using private messages and present the conclusions in english on the forum? If there's something to be changed inthe source code I'd like toknow what and why.

Mark
Galdarius
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 23.07.2006, 19:21
Contact:

Post by Galdarius »

mdaems sorry..
with this changes in source code, it does not depend of gds32.dll
he check in this order:

fbembed.dll
fbclient.dll
gds32.dll

understand?
this is a Signature
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post by gto »

mdaems wrote:Can somebody tell us what this is all about? I understand it's easier four you to communicate in you own languages, but can you doit using private messages and present the conclusions in english on the forum? If there's something to be changed inthe source code I'd like toknow what and why.

Mark
Sorry mdaems, he doesn't speak english well (neither me). This piece of code implements the idea that I talked about up there, checking for file existence before loading it. Well, my idea is just a thougth. Deep in code, there's a object called TZNativeLibraryLoader, that receives the name of all possible library names that can be loaded and go through them, trying to find one that suits.

Galdarius, I think it's a good idea to change the loading to try embedded too, not only fbclient.dll and gds32.dll. But, as I said, there's already a method to check them (TZNativeLibraryLoader.LoadNativeLibrary, in ZPlainLoader.pas, take a look). It will be more clear, and "Zeos compliant" load them from there.

By the way, the code works very well, but it's "hand work", we may do this look a little more "beauty" :)

Ah, if you wanna talk in portuguese, add me at MSN Messenger, send email or even PM. It's good to everyone understand each other, talking english :D

// Se tu quiser me adicionar no MSN, ou mandar email ou ainda por PM, pq a galera aqui gosta de ver tudo em ingles ;)
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi, gto and Galdarius. What zeoslib version are you talking about, as we have added some more support for embedded driver recently and those changes are not in the attached file. (see http://users.telenet.be/mdaems or SVN testing branch for most recent version we have)
Now we have a separate protocol for firebird15 embedded (firebirdd-1.5). Maybe we should add the gds file again as an alternative to the fbclient.
About using fbclient as a failover for the fbembed dll I'm not so sure. If you don't know if an embedded library is available you should check before you select 'embedded' as protocol (eg using the code above by gto).
Usually if I'm not sure about the protocol the user has available I put it in an ini file, so it can be configured on every PC depending on the circumstances. Or you could give the user the choise (only for users who know themselves what these protocols are about, eg. admin programs)

My english isn't very excellent either. Don't care about that too much. We'll do our best to understand and your english becomes better as you use it more. GTO, I like the way you try to help your collegue by giving some Portuguese translation. Unfortunately, dutch isn't very help full to most users, I would maybe start doing the same.

Mark
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post by gto »

Right!

My version is the latest SVN one, but he was using the last sourceforge file (alpha-cvs-13/10/2005). I've already sended your site to him too, with the latest packed version ;)

I think becouse Firebird embeded wasn't implemented into his version, he suggested the change.

About language, there's a lot of brazilians here! So many that I can open a brazilian "fork" to provide support and there will be more and more users. Actually, this is a idea to pratice when i'm idle :)

[]'s!
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
Post Reply