Bug Hunting Session
Bug 117513 - Firebird: DATALOSS Data updated (new/edit) using the data Beamer window or Dataform in odt/ods file is lost when odt/ods file is closed.
Summary: Firebird: DATALOSS Data updated (new/edit) using the data Beamer window or Da...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha1+
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 124843 (view as bug list)
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2018-05-08 19:24 UTC by Drew Jensen
Modified: 2019-04-19 18:32 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test file (converted to firebird sdbc) (13.46 KB, application/vnd.oasis.opendocument.database)
2018-05-08 19:25 UTC, Drew Jensen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Drew Jensen 2018-05-08 19:24:00 UTC
Description:
Base when using the embedded firebird data engine does not write data to the disk until the user executes a file save. 

When a registered database using the firebird sdbc is opened in the beamer window (writer or calc) and data is entered into a table there is no way for the user to save the database (odb) file from that UI. The data entered will be lost when the file you are working on closes.

Steps to Reproduce:
1. Download and open the attached firebird ODB file
2. open Tools|Options|Base|Databases 
3. click on new and register the downloaded file.
4. Create a new Calc or Writer file
5. Open the beamer window (View|Data Sources) 
6. double click on the newly registered database name from above
7. open the Tables entry and double click on the first table. (tbl_text_varchar)
8. A table grid displays to the right, in the beamer and shows it is ready to enter new records.
9. Enter a value in tst_data field for a new record.
10. Close the Calc or Writer file 
11. Open the database file.
12. Open table tbl_text_varchar

Actual Results:  
The record you entered, and thought you saved, in the beamer is gone.

Expected Results:
Record was retained in database table.


Reproducible: Always


User Profile Reset: No



Additional Info:
Tested on:
Version: 6.1.0.0.alpha1+
Build ID: ecf50fe71596c3edba8ce437481ab80ae1cd8935
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-05-08_00:13:13
Locale: en-US (en_US.UTF-8); Calc: group


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36
Comment 1 Drew Jensen 2018-05-08 19:25:07 UTC
Created attachment 141987 [details]
test file (converted to firebird sdbc)

Test firebird sdbc file
Comment 2 Robert Großkopf 2018-05-09 05:56:55 UTC
You are right. 
It is the same behavior when writing data in the table. The Save-button will be disabled after changing row - looks all pretty. Then you could close your document. When you use the databrowser in Writer or Calc there won't be any dialog for asking: Do you want to save your data. There is no possibility to save the data.

Again: We should save data automatically: bug 117118.

But this is set to enhancement ...
Comment 3 Lionel Elie Mamane 2018-05-09 13:13:36 UTC
This scenario is indeed problematic. Tamas, any thoughts?
Comment 4 Drew Jensen 2019-04-19 18:11:17 UTC
*** Bug 124843 has been marked as a duplicate of this bug. ***
Comment 5 Drew Jensen 2019-04-19 18:32:06 UTC
(In reply to Drew Jensen from comment #4)
> *** Bug 124843 has been marked as a duplicate of this bug. ***

I think the solution is fairly straight forward.
Move the event where the firebird database is written to disc from out of the file save function into the connection close function. 

How much that would take to move IDK but I'd bet dimes to euros that it would fix it and fix this new dup issue which is not about the beamer but about external forms (dataforms embedded in odt/ods/etc files), which act just as the beamer does.

So; one thing. If you open the ODB before you close the file the external dataform is in (beamer or doc.drawpage.forms) the update data is visible in the ODB table, and if still open after you close the odt/ods the data is not lost. You just have to save the ODB file to make it stick.