July 05, 2002
Dynamics, rollback and rollforward
An ugly hack has been preying on my mind since I wrote, about the tour, If a transaction "from the past" arrives, the database will unwind, then roll forward again after applying the new transaction... To catch any "futurity", I wrap a GUID inside each event, and maintain a reasonably-sized table of already-handled events.I knew that was ugly (and stupid and wasteful) when I wrote the code, too. There really had to be a way to ask Dynamics whether it's currently rolling back or forward, or processing commands for the first time. There is, of course. It's in Dynamics, and I only stumbled across it this morning whilst debugging something else, so now I applied it onto the tourcode too. This improves performance, reduces the memory footprint (no need for a stupid hashtable now), reduces network traffic (no need for a GUID on the event elements), and improves reliability too. Whenever you want to track state dynamically in a Groove tool, you should know about this. The interface to look at is IGrooveCommandContext2; this is accessible by a property on IGrooveDynamicsManager. So you can get this in Script by var pDynMgr = PropertyList.OpenProperty(PROPERTY_DYNAMICS_MANAGER); then look at the properties on this interface, which tell you more than you ever needed to know. The RollbackRollforward property is true if this is part of a rollback or rollforward. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
vcard
archives: January 2005 December 2004 November 2004 October 2004 September 2004 August 2004 July 2004 June 2004 May 2004 April 2004 March 2004 February 2004 January 2004 December 2003 November 2003 October 2003 September 2003 August 2003 July 2003 June 2003 May 2003 April 2003 March 2003 February 2003 January 2003 December 2002 November 2002 October 2002 September 2002 August 2002 July 2002 June 2002 May 2002 April 2002 March 2002 February 2002 January 2002 December 2001 November 2001 October 2001 September 2001 August 2001 July 2001 June 2001 see also: {groove: [ ray, matt, paresh, mike, jeff, john ], other: [ /* more blogroll to follow */ ] } The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer. RSS 2.0 RSS 1.0 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||