MySQL delay activity on idle persist _smartTimer is null

Nov 26, 2008 at 6:16 AM
I have a sequence workflow setup which has a delay activity. I also have UnLoadOnIdle="true" so that the workflow will be persisted once the delay activity runs. 
When the workflow hits the delay activity it does get stored in the INSTANCE_STATE table. However the public function 

public void Complete(Boolean succeeded, ICollection items) in class "GenericPersistenceService" get's run and tries to update the timer. However for some reason the timer object is null and i get a null reference exception. 

foreach (PendingWorkItem item in items)
   if (item.Type == PendingWorkItem.ItemType.Instance && item.NextTimer != null)
      _smartTimer.Update(item.NextTimer.Value);  /* This is the null reference line :) */

I'm not sure if i have set my timer up wrong or there is something else funky going on.
Nov 26, 2008 at 9:53 AM
Hi rupurt,

When you constructed your AdoPersistenceService what did you set the loadInterval parameter to? If loadInterval is configured to be TimeSpan.Zero then the timer is never configured. Unfortunately there is a bug in the code whereby the smart timer is never checked for a null value, hence the exception you're receiving. If you configure loadInterval to be something like TimeSpan.FromSeconds(30) then timers will be fired every 30 seconds.

Let me know if that fixes it for you!


Nov 26, 2008 at 11:32 AM
Edited Nov 27, 2008 at 12:45 AM
Great I'll give that a try when i get in the office tomorrow

EDIT: Just confirming that it did work :)