SQL Woes on 1.6 II: The Quest for Currency

Michael T. Garrison Stuber garrisonstuber@bellsouth.net
Thu, 26 Jul 2001 00:22:43 -0400


Ah the joys of beta testing . . .

My many thanks to Linas for updating the SQL backend.  I synced to head on 
1.6, rebuilt GNUCash, and installed.  (FWIW, I always do a fully clean 
build if I'm going to do an install).  And then I fired it up.  Here is 
where things got interesting . . .

I started by opening my XML file, and saving into the database I had been 
using.  That worked reasonably okay, but I got an error saying that the DB 
was in use by another user (it wasn't).  So I figure it was time for the 
real test.  I hit save, and it didn't do all the stuff it was doing before 
(I'd be more precise but I'm tired) so Linas's fix is at least doing part 
of what it should do.  Then I hit exit.  It takes it a bit, but it's an 
improvement over how it had been running.  (Yeah) And then I try to reopen 
GNUCash and things really get interesting . . .

I get this error saying:
Warning: xaccTransSetCurrency: Transaction currency seems to be 
inconsistent.
        defacto common=(null), asked to set ISO4217::USD
repeating again, and again, and again. (It seems to repeat for almost as 
many accounts as I have).
And low and behold almost all of my balances are gone, except for the stock 
accounts.

So I figure, "well maybe it's just a corrupt DB, and I'll start over again"

So I reload my XML file and save it to a new DB.  I get lots of wierd 
errors.  It's at this point I realize that either GNUCash or Postgres gets 
confused with mixed case database names.  (Did I miss this in the 
documentation?  There should probably be some handling for this -- it's not 
like a user won't try it.)  So I try all over again with yet another (and 
this time all lowercase) DB name.  I save my data into the database. 
Everything looks beautiful.  I exit and reload from the database, and poof! 
(yes, that's a technical term) I'm getting the currency errors and my 
balances are non-existent.

I recall (ever so dimly) from the list some discussion of a second currency 
type being removed (added?) to the split.  Is it possible that this change 
was inadvertently introduced/removed from 1.6?

Also, I am consistently getting the "Can't get lock DB is in use" error 
from GNUCash, even though the DB isn't in use.  This is happening whenever 
I run in single-update mode, regardless of the database.

Anyway, if somebody's got the bandwidth to fix this, I'll be happy to beat 
on it some more.  Thanks to all.