New database backend and multi-user

Geert Janssens janssens-geert at
Mon Sep 7 10:19:12 EDT 2009

Thanks for the info. I have added some more comments inside your replies.

From what I understood by following the dev list, converting gnucash to a true 
db based application is at best a long-term goal. That would solve the multi-
user aspects automatically, as the consistency in concurrent access would be 
guaranteed by the db engine.

However, gnucash is far from there yet. So the alternative seems to be: make 
sure there's only one user accessing the db at any one time. With xml files 
this was handled with a lock file. Is something similar implemented in the db 
backends ? I mean, if one person is running gnucash a postgres backed book, 
and another person tries to start gnucash with the same postgres backed book, 
will he get the "This book seems to be open by another person" dialog box ? 
That would be sufficient for now.



On Sunday 6 September 2009, Phil Longstaff wrote:
> There are a couple of problems with the current db back-end with respect to
> multi-user access.
> 1) locking/transactions - db transactions are used whenever an object is
> written or updated.  However, no locking is done, and there are certain
> cases where related objects are not saved in the same db transaction,
> because the back-end does not have enough information.  For example, when a
> transaction with multiple splits is saved, each of these is a separate
> engine object and is saved separately.  The back-end API would need to be
> modified to add "start- transaction" and "end-transaction" calls so that
> multiple objects could be saved/committed/rolled back together.
> 2) Update notification - Most objects are read when the db is opened and
> not read again.  Some databases (postgres? not mysql?) provide a callback
> when an update is made, so that data can be refreshed.  An alternative
> would be a timer to refresh.
> 3) Mechanism to handle conflicts - How should the cases be handled when
> different people make conflicting changes?
> Phil
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at

More information about the gnucash-devel mailing list