[GNC] Unexpected behaviour of locking mechanis

John Ralls jralls at ceridwen.us
Sat Apr 20 10:53:13 EDT 2019



> On Apr 20, 2019, at 5:58 AM, mc <mc8 at privmgt.com> wrote:
> 
> Config:
> gnucash 3.5 clean install.
> (X)ubuntu Linux 18.04
> gnucash files saved as sqlite.
> 
> Am new to gnucash and testing it.
> 
> I keep several versions of a gnucash file,
> saved with names like <file>-<date>-<id>.gnucash
> 
> After cleanly exiting gnucash by a normal Quit,,
> I may try to open an earlier saved version.
> I frequently get the message:
> 
> GnuCash could not obtain a lock for .../<filename>.gnucash
> the database may be in use by another user, in which case you should not open the database.
> What would you like to do?
> open read only / create new file / open anyway / quit
> 
> I have checked that gnucash is not running,
> and there is no lock file to be found.
> I open it anyway, and it is without problems,
> other than my tabs have disappeared and there is only the default "Accounts" tab.
> 
> In fact there is no .LCK file even when gnucash has a file opened.
> 
> So:
> a.  has gnucash changed the locking mechanism in v3
> or do sqlite files not use a locking mechanism?
> 
> b.  is there a possible issue with this locking mechanism?

The SQL locks are in a table inside the database, not in a separate file. The file will be locked if you didn't properly quit GnuCash the last time you had *that file* open.

The locking mechanism itself hasn't changed, but the SQL/DBI backend got a complete rewrite into C++ for GnuCash 3.x.

It's a computer program. Of course it's possible that there's a problem, and since you're doing something a bit different from what everyone else does you might be the first to have found it. How are you creating these "earlier saved versions"?

Regards,
John Ralls



More information about the gnucash-user mailing list