Sequential loading of entities (was GnuCash-2.0 first impressions)

Derek Atkins warlord at MIT.EDU
Thu Jan 19 15:49:19 EST 2006


Quoting Neil Williams <linux at codehelp.co.uk>:

> On Thursday 19 January 2006 6:11 pm, Derek Atkins wrote:
>> In
>> particular, GnuCash requires that the Commodity Tables, Account list,
>> and Account Balances get pre-loaded..  But all transaction information
>> is loaded on demand.
>
> I've been meaning to ask something along those lines:
>
> When splits are loaded in a backend module, is it *essential* that the parent
> Trans exists and is open or is it a step that can be delayed until the parent
> Trans (which occurs later in the input) has been loaded? i.e. if a load
> process comes across the Split before reaching the Trans - must it create a
> holding space for the Split data? (I realise existing functions may need to
> be modified or re-implemented as private copies.)

I'd have to go research that.  Keep in mind that "open" is sort of meaningless
for a backend.  The backend owns the data, not the engine.  The engine is
just a cache.  However it is the backend's job to make sure that the engine
cache meets the data invariants.  That means that the backend is in charge
of making sure that the loaded data is "complete".

In terms of splits, that means that when the load completes, all splits must
be tied to transactions, and all transactions must have all associated splits.
I believe it IS reasonable for the backend to load this in multiple steps,
but it must be one "operation" as far as the caller INTO the backend is
concerned.

> If events are suspended until the load completes, does that make a 
> difference?

I'm not sure..  The old postgres backend used temporary placeholders and
then filled in the placeholders later during the load process.

> All this assumes the creation of an intermediate QofBook that is subsequently
> merged into the main book. i.e. the data loaded from the input is not
> processed by the main application until all the content has been processed.

Keep in mind that such a "merge" must be UI-less.  In a GNC Backend such
an intermediate QofBook isn't necessary.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list