Default dll
Moderators: gto, cipto_kh, EgonHugeist
Default dll
on firebird connection, why not load library in this order?:
fbembeded
fbclient
gds32
fbembeded
fbclient
gds32
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
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
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
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.
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.
humn...
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
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
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:
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!
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');
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!
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
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
yessssssssssssssssssssssssssssssssssssssssssssssss
Work Great!!!!!!!!!!!!!!!!!!!!
see this..
lets deploy to all!!!
see this..
lets deploy to all!!!
this is a Signature
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.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
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
// Se tu quiser me adicionar no MSN, ou mandar email ou ainda por PM, pq a galera aqui gosta de ver tudo em ingles
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
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
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
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!
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!