Bug 143905 - Firebird. Connect to a firebird server with incorporated driver
Summary: Firebird. Connect to a firebird server with incorporated driver
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: jcsanz
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-16 17:42 UTC by jcsanz
Modified: 2022-08-24 10:09 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jcsanz 2021-08-16 17:42:15 UTC
Description:
One of the most requested features, in relation to Base databases, is the ability to maintain a multi-user database.
Since firebird is going to be the default embedded database manager, the logical evolution to solve the problem and convert a single-user database into a multi-user database is to export the embedded database to a firebird server. 
Extracting the data file from the .odb file is not a big problem. However the connection to the firebird server is not easy from Base.
Currently you can create an embedded firebird data file, you can also create and connect to a firebird file external to the .odb file (this connection does not support multiple users simultaneously), but there is no built-in way to connect to a firebird server, as there is, for example, for mysql or postgres.
Incorporating a way to connect to a firebird server would be a great improvement that would help increase the number of Base users by easing the transition from an embedded database to a multi-user database.

Actual Results:
It is not possible to connect to a firebird server without an externarl driver

Expected Results:
Connection to a firebird server with incorporated driver


Reproducible: Always


User Profile Reset: No



Additional Info:
N/A
Comment 1 m_a_riosv 2021-08-16 20:51:29 UTC
If you have running the Firebird server .x version, then you can connect to it from base connecting to an existent database 'Firebird file'. Even you can create a new one.
Comment 2 jcsanz 2021-08-16 21:40:20 UTC
(In reply to m.a.riosv from comment #1)
> If you have running the Firebird server .x version, then you can connect to
> it from base connecting to an existent database 'Firebird file'. Even you
> can create a new one.

Yes, I know and I have said so in my request, but this connection is not multiuser, which is the main reason for the request, , besides other advantages (user control, for example) that the server provides and cannot be achieved with the current connection to the file.
Comment 3 m_a_riosv 2021-08-16 22:02:31 UTC
Ok let's see, I have not tested, I connect to a FB 2.5 database in windows through ODBC from LO.

Maybe LibreOffice is using fbembed.dll to access FB server, fbembed.dll blocks other access to the same database.
A trick could be to copy fbclient.dll from the FB server installation, overwritten the LO fbembed.dll  I use this way to connect with other program FB's database.
Comment 4 jcsanz 2021-08-16 22:53:40 UTC
(In reply to m.a.riosv from comment #3)
> Ok let's see, I have not tested, I connect to a FB 2.5 database in windows
> through ODBC from LO.
> 
> Maybe LibreOffice is using fbembed.dll to access FB server, fbembed.dll
> blocks other access to the same database.
> A trick could be to copy fbclient.dll from the FB server installation,
> overwritten the LO fbembed.dll  I use this way to connect with other program
> FB's database.

I´m not asking a solution of my problem, but an easy way to escalate from embedded database to a server one for any user
Comment 5 Robert Großkopf 2021-08-17 06:04:40 UTC
At this moment we are far away from Firebird as default. We have set Firebird back to experimental, because it doesn't work as expected together with the GUI. And nothing has been changed in this situation since it is set back to experimental in LO 6.4.3

You could wish an enhancement - but the first, which should be working well, is the internal version of Firebird.

You could connect to a Firebird server in multiuser-mode with ODBC. Here the files, described in German Base Handbuch:

odbcinst.ini
[Firebird]
Description = Firebird ODBC driver
Driver64 = /usr/lib64/libOdbcFb.so
odbc.ini
[Firebird-libretest]
Description = Firebird database libreoffice test
Driver = Firebird
Dbname = localhost:/srv/firebird/libretest.fdb
SensitiveIdentifier = Yes

For JDBC you get the driver here:
https://www.firebirdsql.org/en/jdbc-driver/
The driver is called: org.firebirdsql.jdbc.FBDriver
The connection string for the same database is
jdbc:firebirdsql://localhost/libretest.fdb?charSet=UTF-8
Comment 6 m_a_riosv 2021-08-17 20:17:20 UTC
(In reply to jcsanz from comment #4)
> (In reply to m.a.riosv from comment #3)
> > Ok let's see, I have not tested, I connect to a FB 2.5 database in windows
> > through ODBC from LO.
> > 
> > Maybe LibreOffice is using fbembed.dll to access FB server, fbembed.dll
> > blocks other access to the same database.
> > A trick could be to copy fbclient.dll from the FB server installation,
> > overwritten the LO fbembed.dll  I use this way to connect with other program
> > FB's database.
> 
> I´m not asking a solution of my problem, but an easy way to escalate from
> embedded database to a server one for any user
Then please change the title to add something like 'in multiuser mode'
Comment 7 jcsanz 2021-09-04 15:27:23 UTC
I have been looking at the code and it is not necessary to provide a new driver, it is enough to modify some parts of the code to deal with the username and password. I have done that and it worked for me. I have sent a patch for review https://gerrit.libreoffice.org/c/core/+/121638. 
I am now looking at how to modify the interface so that the user can log in. Although I have already done it, it is giving me some errors.
Comment 8 Commit Notification 2021-09-09 19:22:18 UTC
jucasaca committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/34219c3cb737371afb4a29604e95f0e87966f02a

tdf#143905: Parse password from connection string

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.