Issue 55496

Summary: embedded databases are prone to data loss
Product: Base Reporter: Frank Schönheit <frank.schoenheit>
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P2 CC: fabian.klabunde, helge.kraak, issues
Version: 680m130   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Frank Schönheit 2005-10-05 12:28:54 UTC
Embedded (HSQLDB) databases are prone to data loss in case of abnormal
terminations of the OOo process.

That is, if you write data into a database (by UI or by scripting), this data is
not immediately commited to the database (the .odb) file, but still stored in
some temporary location. If now OOo terminates (crashs, or is killed)
abnormally, then this data is lost - not even the document recovery which
(perhaps) offers to restore the database upon next start does catch the data.

This is certainly undesired behavior for a database.

While it's difficult to fix this with our current approach, where the data is
just some sub-streams in a ZIP package, we need to somehow address this. I fear
this might in fact only be possible with a package format (replacing the ZIP
package format for this purpose) which allows O(1) random access to all of its
parts.

For the record: We tried to relax the situation for OOo 2.0.1 with fixing issue
55493: we introduced a few places where the changes in the DB data are synced
back to the .odb file. They're (hopefully) often enough to significantly reduce
the chance for a data loss, and seldom enough to be seriously noticed.
Nevertheless, this is not really a final solution.
Comment 1 fabianklabunde 2006-11-28 17:10:30 UTC
For the time being it would be helpful to know the "places where the changes in
the DB data are synced back to the .odb file". That way one might be able to
secure one´s data without shutting OOo down. 
Fabian 
Comment 2 Frank Schönheit 2006-11-30 11:26:11 UTC
This is basically every time you release a connection in the data source browser
(the thingie you get with "F4" in the other apps), and when you close a table or
query view.
Comment 3 Frank Schönheit 2006-11-30 11:27:24 UTC
Additional note: If you want to programmatically want to sync back the changes,
call XFlushable::flush at a connection object.
Comment 4 helgekraak 2006-12-12 22:54:32 UTC
This may help some OO users:
http://www.oooforum.org/forum/viewtopic.phtml?t=43786&start=15