Hi Daniel,
The code is adding a row to a database (Base-Document with embedded
HSQL-DB) every time it gets called. However the changes are lost after
closing OOO. To make them permanent it's necessary to flush() the
DataSource.
First question: This is not exspected bahaviour, is it? Changes should
be persistently saved without calling flush(), or am I wrong?
Well ... the problem with the ZIP-file approach of ODBs is that it is
impossible to immediately write all changes you did to the file.
(Anybody wishing to start a discussion how this violates fundamental
database principles ... please direct your concerns to the ODF faction.
I'd be grateful for any assistance in explaining why ZIP as a database
backend is a joke, at best.) That's basically a question of performance.
So, some kind of flushing is necessary. This is inconvenient, but in the
above sense, expected behavior.
However, note that your macro contains a resource leak, in that it
retrieves a connection, which it does not dispose afterwards - at the
very end of the Sub, you should have a
Connection.close()
This should free the resources associated with the connection, and at
the same time flush its changes.
But the trouble gets worse... The flush() - workaround works fine on
Linux (Using OOO 3.2.1 and 2.4 on Debian), but it crashes OOO 3.2.1 on
Windows (XP) ungracefully.
If you can create a small self-contained .odb (including the macro)
showing this, please submit an issue at
http://www.openoffice.org/issues/enter_bug.cgi?component=Database%20access.
Feel free to assign it to me (fs).
Ciao
Frank
--
ORACLE
Frank Schönheit | Software Engineer | frank.schoenh...@oracle.com
Oracle Office Productivity: http://www.oracle.com/office
-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org