QOF 2-part commit / 2.3.2

Phil Longstaff plongstaff at rogers.com
Tue Jun 23 09:39:31 EDT 2009


I remembered a discussion a few years ago on the devel list and looked it up.  Not much help.

I'll remove the backend call from part 1 and do more testing.

Re 2.3.2: I would like to get this bug fixed for 2.3.2.  I also want to finish up building the libdbi mysql/postgres drivers as part of the win32 build before 2.3.2.  People are testing and finding bugs, which is *great* and I want to reach as wide an audience as possible.

Re: should we put a copy of each dependency somewhere for our use?  I'm not sure we need to unless sites have the policy of removing old versions.  webkit-gtk does, which is why I put a copy of webkit-gtk-1.15 (or whatever it's called) on sourceforge/gnucash.org.  For gnutls, I just assumed the 2.7.X was an unstable version made obsolete by the release of 2.8.0.  If we could build, zip, then put the zip somewhere, it would speed up win32 builds, but most people don't worry about that.  They just download the installer and run.  You would need both 32/64 bit versions.  Hmmm.   On the one hand, copying the source tarballs to our own repository allows us complete control over what versions we use.  I guess it really doesn't imply that we support them at all.  Downloading from the source site is a real signal that we use the official version, not a locally patched version.  However, we often download source and then patch anyway.  I guess I could go either
 way on that one.

Phil

P.S.  Don't forget to include the devel-list ;)



________________________________
From: Derek Atkins <warlord at MIT.EDU>
To: Phil Longstaff <plongstaff at rogers.com>
Sent: Tuesday, June 23, 2009 9:16:58 AM
Subject: Re: QOF 2-part commit

I dont remember why part1 calls the backend..  I'm not sure why it would
or should.  A lot of the part1 is to deal with nested 'begin_edit'
sections.

-derek

Phil Longstaff <plongstaff at rogers.com> writes:

> part1 *also* calls the backend.  The SQL backend clears the dirty flag.  The
> enter date is then set.  Then part2 calls the backend again, but the dirty
> flag is clear, so the sql ignores it.  If I set the dirty flag when the enter
> date is set, the part2 backend call tries to insert the transaction into the
> db again - it uses the infant flag to choose whether to INSERT or UPDATE.
>
> My guess is that part1 should not call the backend.  That should work for most
> engine objects which call part1 and then part2, either immediately or after
> doing a bit of stuff.  I know there are a few places in the code (some qof
> copy/replication functions?, also some qof setter functions in the engine
> objects) where qof_begin_edit() and qof_commit_edit() bracket some function
> calls and there is no part2 call.  I'll have to figure out how to trigger them
> to test them.  
>
> Phil
>
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> From: Derek Atkins <warlord at MIT.EDU>
> To: Phil Longstaff <plongstaff at rogers.com>
> Cc: Gnucash list <gnucash-devel at lists.gnucash.org>
> Sent: Tuesday, June 23, 2009 8:56:37 AM
> Subject: Re: QOF 2-part commit
>
> Phil Longstaff <plongstaff at rogers.com> writes:
>
>> With the SQL backend, the date-entered for transactions is being save as jan
> 1
>> 1970.  The problem is with the 2-part commit.
>>
>> xaccTransCommitEdit() calls qof_commit_edit() (1st part), then sets date-
>> entered to the current time, then calls qof_commit_edit_part2() (2nd part). 
>> However, since the transaction is marked clean during the 1st part, and not
>> marked dirty again, the 2nd part does nothing, so the date-entered is not
> set
>> in the db.
>>
>> Is the 2-part commit meant to implement the standard 2-phase commit for a
> db? 
>> If not, what is the purpose?
>
> Well, according to the docs for those two functions:
>
> * commit_edit helpers
> *
> * The caller should call PART1 as the first thing, then
> * perform any local operations prior to calling the backend.
> * Then call PART2. 
>
> * part1 -- deal with the editlevel
>
> * part2 -- deal with the backend
>
> They are separated because there were local operations that had to
> happen for various objects between the two portions..  But I don't
> recall anymore why the separation -- it's been nearly a decade since
> I worked on that code.
>
> I also don't recall why the 'dirty' flag is cleared in part1.
>
>> Phil
>
> -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
>

-- 
       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