FireBird/LibreOffice: fb_config/pkg-config, thread-safety, eager caching

Lionel Elie Mamane lionel at mamane.lu
Fri Jul 19 00:34:29 PDT 2013


On Fri, Jul 19, 2013 at 08:35:07AM +0200, Andrzej J. R. Hunt wrote:
> On Fri, 2013-07-19 at 04:40 +0200, Lionel Elie Mamane wrote:

>> 3) You seem to have duplicated
>>    connectivity/source/{inc,commontools}/propertyids.[hc]xx
>>    in connectivity/source/drivers/firebird/propertyids.[hc]xx?

>>    With the _same_ include guard?

> These were already there when I started working on the Firebird
> driver -- I'm trying to deduplicate anything that already exists
> elsewhere so I'll look at this too. (I think this probably
> originally came from the skeleton driver in
> odk/examples/DevelopersGuide/Database/DriverSkeleton/ ).

Our skeleton has "bad" example? Urgh. Please keep a list of those
issues, we'll fix them in the skeleton... later.

>> 4) OResultSet::m_sqlData: the driver caches the *whole* resultset? Oh
>>    my... And not only that, it eagerly fetches the *whole* resultset?

>>    I'm not actually sure any LibreOffice code really requires
>>    scrollable cursors; it seems to me that when it detects that the
>>    driver / database does not support that, it makes a *new* query
>>    with "WHERE primary_key=VALUE" each time it wants to "go back"
>>    (this happens in dbaccess/source/core/api/KeySet.cxx and
>>    RowSetCache.cxx).

>>    If FireBird can't support previous() et al, it could just throw an
>>    SQLError when they are called?

> Firebird 3 does apparently support scrollable cursors but 2.5 doesn't --
> I never realized that drivers were allowed to not support previous() --
> I'll remove the local storage and see how things work out.

I'm not completely confident, but it could work.

Essentially, if we do that, the driver will only support
"ResultSetType" value "FORWARD_ONLY", and should throw an SQLERROR if
anything else is asked for (e.g. SCROLL_(IN)SENSITIVE).

Grepping in dbaccess, this seems perfectly supported by LibreOffice in
theory; we'll see if we encounter bugs there :)

Be sure to set the "RespectDriverResultSetType" advanced property for
this driver.

OTOH, in the light of the day, I have a suspicion that some ODBC do
the caching that shocked me so much in the night... Oh well, keep it
in a corner, ready to be pressed into service again if we decide in
the future.

-- 
Lionel


More information about the LibreOffice mailing list