> The one thing I've not been able to fully determine is at what precise
> point a transaction becomes locked, and then becomes unlocked.
Here is my understanding of this:
In the register, a transaction is locked in xaccSRSaveRegEntry()
in src/SplitLedger.c. This function is called on the current
transaction when the user is moving from the current transaction
to a new one (or to a new split in the same transaction) and also
by the GUI when you hit 'record'.
Once a transaction is locked, it is not unlocked until one of
the following:
1. You move out of the transaction (not just into a new split in
the same transaction).
2. You hit 'record' in the register window controls (menu, button, etc.)
3. You close the window (in gnome this will result in a popup asking
if you really want to commit).
The unlocking in 1 & 2 are done in the same call to
xaccSRSaveRegEntry(). The unlocking in 3 is done elsewhere.
The reason a transaction is left open while you are editing its
splits is so you can undo edits to the transaction as a whole.
Locking a transaction also results in the construction of a
backup copy so you can perform an undo.
> - The lock should probably be attempted as soon as the user starts
> entering new data into a field. They press "enter" or "TAB," and
> immediately either succeed, or find that someone else is already
> working on the transaction.
>
> - The harder part is that of relinquishing the lock. In Quicken,
> there's a pretty clear "commit" that takes place with transactions
> after all desired fields get messed with; it's less clear with
> GnuCash when that takes place.
Our record semantics are admittedly a bit complex. OTOH, if you
understand them, they can be much quicker than Quicken semantics,
which requires you to explicitly record every transaction you edit,
and pops up a dialog if you try to leave an edited transaction. If you
want to edit a lot of transactions at once, that can take a lot of extra
time.
One possibility (that would, I think, be simple to implement right
now) is to add a configuration parameter to choose between 'loose'
(current) and 'strict' (Quicken) editing modes. In strict mode, if
you leave an edited transaction, you get a popup telling you so with
options to commit or cancel.
dave
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]