Bug 156584 - Embedded database registered url rule
Summary: Embedded database registered url rule
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-02 14:39 UTC by prrvchr
Modified: 2023-09-08 09:30 UTC (History)
3 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 prrvchr 2023-08-02 14:39:26 UTC
Description:
We will soon have with version 24.02 of LibreOffice the possibility to create as many databases in embedded mode as there are drivers available (provided by LibreOffice or in the form of an extension). See bug 156471

LibreOffice provides the embedded firebird and hsqldb 1.8 drivers and uses the following two urls for this:

- sdbc:embedded:firebird
- sdbc:embedded:hsqldb

I have two extensions SQLiteOOo and HsqlDriverOOo which will be in a next version able to work on a unique / private url and other than sdbc:embedded:hsqldb

What would be the rules, if any, that these new urls should follow?

Actual Results:
 

Expected Results:
 


Reproducible: Always


User Profile Reset: No

Additional Info:
Comment 1 prrvchr 2023-08-12 16:26:43 UTC
We could consider the following two urls, as reserved for the drivers integrated into LibreOffice:

- sdbc:embedded:hsqldb
- sdbc:embedded:firebird

And the following two urls reserved for the use of HyperSQLOOo[1] and SQLiteOOo[2] extensions, respectively:

- sdbc:embedded:hsqldb2
- sdbc:embedded:sqlite

This will allow to differentiate an odb file using the native driver of LibreOffice from an odb file using the driver of the HyperSQLOOo extension.

But we must keep in mind that at any given time one and only one version of the hsqldb.jar driver (for example) can be loaded. Two scenarios can happen:

- the hsqldb.jar driver is in the class path of java.
- the hsqldb.jar driver is loaded by a url class loader.

In the first case (such as if we add the jar archive file in Tools -> Options -> LibreOffice -> Advanced -> Class Path... -> Add Archive... or if you are on Linux with LibreOffice Community and you have installed both packages: libreoffice-sdbc-hsqldb and libhsqldb1.8.0-java) we will be limited to the use of the version of this jar archive.

In the second case (such as using the jdbcDriverOOo, HyperSQLOOo and SQLiteOOo extensions) only the version of the first loaded driver will be available.

So even if we differentiate the LibreOffice driver by different urls, it will not protect us from version conflicts between Java drivers (hsqldb embedded 1.8 vs HyperSQLOOo 2.7.2)

[1] https://prrvchr.github.io/HyperSQLOOo/
[2] https://prrvchr.github.io/SQLiteOOo/
Comment 2 Alex Thurgood 2023-09-06 05:19:31 UTC
@prrvchr: you might want to try to contact Stephan Bergmann about how the loading of the jars might be addressed across the various OSes that the project supports.
Comment 3 Alex Thurgood 2023-09-06 05:22:57 UTC
Confirming, this problem has been around since the release of OOo first supporting embedded hsqldb, and became more acute as hsqldb has evolved in version of the years.
Comment 4 prrvchr 2023-09-06 09:40:50 UTC
@Alex Thurgood:

We will not be able to overcome the limitations specific to Java concerning conflicts between different versions of jar archives.

On the other hand, we can ensure that under Linux the installation of the packages: libreoffice-sdbc-hsqldb and libhsqldb1.8.0-java necessary for the use of embedded HsqlDB loads the jar archive via a URL ClassLoader rather than modifying the Java ClassPath as it seems to do...

I think that improving this specific point requires opening a specific issue...
When I finish my current work, I can take care of it...
Comment 5 Stephan Bergmann 2023-09-08 09:30:08 UTC
(In reply to Alex Thurgood from comment #2)
> @prrvchr: you might want to try to contact Stephan Bergmann about how the
> loading of the jars might be addressed across the various OSes that the
> project supports.

(Just a quick note that I haven't looked into LO's database driver jar loading code in ages.)