After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640061 - Invoice items are not saved
Invoice items are not saved
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Backend - SQL
git-master
Other Linux
: Normal major
: ---
Assigned To: Phil Longstaff
Chris Shoemaker
Depends on:
Blocks:
 
 
Reported: 2011-01-20 13:26 UTC by Christoph Holtermann
Modified: 2018-06-29 22:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
"make check" results in errors in libdbi. (3.76 KB, application/octet-stream)
2011-01-20 14:08 UTC, Christoph Holtermann
  Details
This patch forces invoices to be loaded before entries (717 bytes, patch)
2011-01-30 14:26 UTC, Christoph Holtermann
committed Details | Review

Description Christoph Holtermann 2011-01-20 13:26:53 UTC
When creating an invoice the corresponding transaction is correctly created. When I close the program and want to see the invoice almost all of the data is lost. The lines "Rechnungseinträge" (like the splitlines or transactionlines in ledgers) are missing where the items are specified (I don't know the english names, i use the german version and i don't know how to change the language). 
The note is missing "Bemerkung".

I use the SQL-Backend with MySQL. I tried XML : There it works. I tried Sqlite : there it's the same as with MySQL.

I use SVN rev 20122.
Comment 1 Christian Stimming 2011-01-20 13:47:28 UTC
Which Linux distribution? Which version of the libdbi package? (There is a known issue with some versions of libdbi...)

Also, did I understand correctly: With sqlite, the entries in the invoice are again lost, just as they did with mysql?
Comment 2 Christoph Holtermann 2011-01-20 14:03:37 UTC
(In reply to comment #1)
> Which Linux distribution? 
OpenSuse 11.3

> Which version of the libdbi package? 

Informationen für Paket libdbi0:

Repository: @System
Name: libdbi0
Version: 0.8.3-3.11
Arch: i586
Hersteller: obs://build.opensuse.org/openSUSE:Factory:Contrib
Installiert: Ja
Status: aktuell
Installierte Größe: 96,0 KiB
Zusammenfassung: Database Independent Abstraction Layer for C
Beschreibung: 
libdbi implements a database-independent abstraction layer in C, similar to the
DBI/DBD layer in Perl. Writing one generic set of code, programmers can
leverage the power of multiple databases and multiple simultaneous database
connections by using this framework.


> (There is a
> known issue with some versions of libdbi...)


> Also, did I understand correctly: With sqlite, the entries in the invoice are
> again lost, just as they did with mysql?
Correct.
Comment 3 Christoph Holtermann 2011-01-20 14:08:25 UTC
Created attachment 178841 [details]
"make check" results in errors in libdbi.
Comment 4 Christian Stimming 2011-01-20 14:20:42 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 611936 ***
Comment 5 Christoph Holtermann 2011-01-30 14:26:02 UTC
Created attachment 179632 [details] [review]
This patch forces invoices to be loaded before entries

I saw in the logfile :

* 12:54:17 DEBUG <gnc.backend.dbi>         [conn_execute_select_statement] SQL: SELECT * FROM entries
...
* 12:54:17  WARN <gnc.backend.sql>         [load_invoice_guid()] Invoice ref 'da696198453447bf281addbda5aaecdb' not found

These WARNs appeared several times.

The data loss was actually that when i tried to restore an invoice it all entries missing. Here it seemed to
me that maybe the entries couldn't be loaded correctly because the invoices couldn't be accessed. Manually
looking at the Mysql database i found the entries in a correct way.

Because the data from the MySql database is loaded into memory at the startup and accessed there, i guessed
that they were not found because they hadn't been loaded. I found that forcing the invoices to be loaded before the
entries fixes the problem. I get no WARNs anymore and i can access the entries in the gui.

I think that the Classification of this bug report as a duplicate of the fastmath bug is at least partially an error.
Comment 6 John Ralls 2011-01-30 16:36:33 UTC
OK, I've reopened this pending review and commitment of your patch.
Comment 7 Geert Janssens 2011-01-30 18:36:00 UTC
Review of attachment 179632 [details] [review]:

This fixes the problem of missing invoices. There is a special fixed_order array for the business objects though, so I have taken your changes and applied them there. Credits for solving the problem are yours though. Thanks.
Comment 8 Geert Janssens 2011-01-30 18:41:53 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 9 John Ralls 2018-06-29 22:52:31 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=640061. Please update any external references or bookmarks.