[Libreoffice-bugs] [Bug 53333] New: Using HSQLDB 2.2.9 for development

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Aug 10 12:07:23 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=53333

             Bug #: 53333
           Summary: Using HSQLDB 2.2.9 for development
    Classification: Unclassified
           Product: LibreOffice
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: Database
        AssignedTo: libreoffice-bugs at lists.freedesktop.org
        ReportedBy: fredt at users.sourceforge.net


Background: During the 2004-20011 period, I collaborated with OOo developers
Ocke Janssen and Frank Schoenheit to get Base to work with HSQLDB. I was not
involved in the development of Base itself. My role was to develop HSQLDB to
support the integration. 

We changed the internal, embedded interface between Base and HSQLDB for the
integration of HSQLDB 1.9/2.x (which is a CWS) to allow a more efficient and
robust integration in future versions [1]. As a result, new versions of HSQLDB
no longer supported embedded databases with the older versions of Base (which
include the latest LO and AOO).

The last OOo and recent LO and AOO work fine with HSQLDB 2.x and external (as
opposed to embedded) databases. Enhancements added by OOo devs in their last
release seem essential.

Before the release of HSQLDB 2.2.9 I spent some time trying to get it to work
with embedded Base by restoring support for the old interface (while
maintaining CWS integration when necessary). This work was partly successful
but it is not complete due to lack of time. Updates do not work, as the
embedded file stream is closed.

The result is still useful for development, especially when investigating the
regression issues related to both Java and Base versions that are reported
elsewhere.

A special HSQLDB 2.2.9 jar needs to be compiled after uncommenting a line in
the org.hsqldb.persist.HsqlDatabaseProperties#save() method. A Jar will be made
available for this purpose (development use only) here
http://hsqldb.org/web/openoffice.html. 

HSQLDB 2.2.8 / 2.2.9 supports logging database events and SQL statements with
these statements:

SET DATABASE EVENT LOG LEVEL 3
SET DATABASE EVENT LOG SQL LEVEL 3 

Separate .app.log files are created alongside the .odb file, containing the
details of what goes on. One contains lines like this:

2012-08-04 12:28:23.890 NORMAL Checkpoint start
...
2012-08-04 12:28:23.890 NORMAL Checkpoint end

End users currently using version 2.2.8 / 2.2.9 with external file or server
databases can also enable the logs to see details of executed statements. [2]

I compared the source code of AOO 3.4 and LO 3.6 and found only minor
differences in database access. I tested with AOO as I was upgrading from OOo
3.2 on Windows.

While testing with a simple embedded database and AOO, I noticed the CHECKPOINT
statement is being sent to the embedded database after each SELECT statement
(these are issued internally while browsing table contents). This should not
happen. A CHECKPOINT uses significant resources and rewrites the .script and
.backup files even if the data has not changed at all.


[1] The new interface, org.hsqldb.persist.RandomAccessInterface includes
methods that are called from HSQLDB when the contents of the .data file need to
be persisted and when the size of this file is increased prior to adding new
data. Implementation of these methods inside Base could avoid memory errors
that could corrupt the embedded database.

[2] A less advanced form of EVENT LOG is supported by HSQLDB 1.8.0 and set via
a URL property (no SQL statement is available).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Libreoffice-bugs mailing list