Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't mix in one process remote connection using fbclient.dll from 2.* (or 3.0) with embedded connection using fbclient.dll from 3.0. [CORE5123] #5407

Open
firebird-automations opened this issue Mar 2, 2016 · 14 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Nick (nick)

Votes: 2

- have runned firebird 2.5
- have only fbclient.dll from 2.5 in D:\Firebird\FB25Client
- have only fbclient.dll from 3.0 RC2 in D:\Firebird\FB30Client
- have all files from 3.0 RC2 in D:\Firebird\FB30
- all connections uses charset WIN1251.

code:
begin
AttachDatabase('D:\Firebird\FB25Client\fbclient.dll', '127.0.0.1:D:\Data\FB25.fdb', 'SYSDBA', 'masterkey'); // remote connect to 2.5
AttachDatabase('D:\Firebird\FB30\fbclient.dll', 'D:\Data\FB30.fdb', 'SYSDBA', 'masterkey'); // embedded connect to 3.0
end.
Error on second attach:
--------------------------------------------------------------------------------------------
Error loading plugin Engine12
Module D:\Firebird\FB30\plugins/Engine12 exists but can not be loaded
Unsuccessful execution caused by system error that does not preclude successful
execution of subsequent statements
GDS Code: 335545004, SQL Code: -901, Error Code: 684
--------------------------------------------------------------------------------------------

Example with only 3.0 libraries:
begin
AttachDatabase('D:\Firebird\FB30Client\fbclient.dll', '127.0.0.1:D:\Data\FB25.fdb', 'SYSDBA', 'masterkey'); // remote connect to 2.5
AttachDatabase('D:\Firebird\FB30\fbclient.dll', 'D:\Data\FB30.fdb', 'SYSDBA', 'masterkey'); // embedded connect to 3.0
end.
Error on second attach:
--------------------------------------------------------------------------------------------
bad parameters on attach or create database
CHARACTER SET WIN1251 is not defined
Connection error
GDS Code: 335544325, SQL Code: -924, Error Code: 5
--------------------------------------------------------------------------------------------

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

It is nor recommended nor good way to create application in a such way and nobody promises it is even going to work.
I speak about load many different fbclient's at the same time into same process.
It look as exotic at least.

In your first sample it is easy to use fb3 client to make rmote connection to fb2.5 server and embedded connection to the v3 database.

In your second sample you should use single client at D:\Firebird\FB30

I see no reason to treat this ticket as too important therefore will lower its priority

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

priority: Major [ 3 ] => Minor [ 4 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Nick (nick)

I have this problem when work with IBExpert.
I think It must be fixed or clearly stated in release notes.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> It is nor recommended nor good way to create application in a such way and nobody promises it is even going to work.
> I speak about load many different fbclient's at the same time into same process.
> It look as exotic at least.

I completely disagree. There should be no good reason for at least the client do not work in this way.

I do not talk about priority, but it's surely a bug and has nothing exotic.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Adriano,

client works. The current issue all about embedded.

@firebird-automations
Copy link
Collaborator Author

Commented by: @ibaseru

questions:

1. are AHandle returned by LoadLibrary different after 2nd LoadLibrary call?

2. what if after 2nd LoadLibrary you make a call in the first attachment, not in the second?

@firebird-automations
Copy link
Collaborator Author

Commented by: Chau Chee Yang (cheeyang)

The issue should be fix. It is consider a bug. Loading both Firebird 2.5 and 3.0 fbclient.dll in the same process should always allow and encourage to do so as long as the application using match dll handle to access match firebird database. It doesn't violate any rules at all.

Loading both DLL in same process is useful for application that need to access both Firebird 2.5 and 3.0 database at the same time. One such usage is migrate the Firebird 2.5 data to Firebird 3.0 database.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Chau Chee Yang,

read my answers above.

@ccy
Copy link

ccy commented Oct 4, 2022

This issue can replay in Firebird 3.0 and Firebird 4.0 too.

@hvlad
Copy link
Member

hvlad commented Oct 4, 2022

Could you specify, please - what exact issue do you speak about ?
I ask because your previous comments was far from the original "issue".

@ccy
Copy link

ccy commented Oct 4, 2022

Trying to attach to both Firebird 3.0 and Firebird 4.0 embedded database in a windows process with these steps:

  1. Attach a firebird 3.0 database with embedded connection using firebird 3.0 fbclient.dll
  2. Next, attach a firebird 4.0 database with embedded connection using firebird 4.0 fbclient.dll shall prompt
Error loading plugin Engine13
Module c:\firebird\4.0\plugins/Engine13 exists but can not be loaded

@AlexPeshkoff
Copy link
Member

You should add Engine12 (from fb3) to fb4, configure it in firebird.conf and use fb4 fbclient to attach both fb3 & fb4 databases.

@ccy
Copy link

ccy commented Oct 5, 2022

@AlexPeshkoff, both fb3 and fb4 plugins has DLL file using same file name but different file size. Moving engine12.dll to fb4/plugins may cause some dependency or compatibility issue that can be hard to trace later.

@AlexPeshkoff
Copy link
Member

AlexPeshkoff commented Oct 5, 2022

No issues, it's recommended way to open both types of databases in single process. Pay attention - I do not suggest to copy all plugins but for engine that does work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants