locked
Custom persistence service in .Net 4.0 RRS feed

  • Question

  •  

    hi,
    i have tried persistenc workflow in .net 4.0 using
    SqlPersistenceProviderFactory and PersistenceProvider
    and it works fine, but in that i have to use some predefined database and tables of microsoft.

    but what if i want to use my own database with own table structure. in 3.5 i have used by defining class which is derived from WorkflowPersistenceService and impliments its methods.
    but in .net 4.0 i am not able to find any classes like that.
    can you please help me out..

    Regards,
    joyous suhas

    Wednesday, August 19, 2009 12:00 PM

Answers

All replies

  • You need to create two derived classes - one from PersistenceProviderFactory, and one from PersistenceProvider.  The factory creates instances of the individual providers, each provider is usually created for a single workflow instance.  So you do any pooling, etc. in the factory, and each provider gets created for a given instance and is responsible for loading, etc. 

    HTH,
    Matt

    Check out Pluralsight On Demand! http://www.pluralsight.com/main/olt/
    Wednesday, August 19, 2009 2:29 PM
  • hai matt,
    thanks for quick reply..
    will check it out your solution.
    just one confustion, in which override function i have to write my insert query to store workflow in database.

    Regards,
    joyous suhas
    Thursday, August 20, 2009 5:40 AM
  • hi matt,

    also if you have any link for some sample code then please do let me know. it makes my life easy to understand this fundamentals.

    Regards,
    joyous suhas
    Thursday, August 20, 2009 6:40 AM
  • Hi,

    ==> you can there find an exemple of file persistence (WF_WCF_Samples\WF\Basic\Persistence\NoPersistZone\CS\NoPersistZone)

    Regards,

    Shadew
    Thursday, August 20, 2009 6:56 AM
  • Check out the sample in the SDK as indicated by Shadew and you'll see that you need to override the Update (or BeginUpdate, EndUpdate for asynch) to insert or update an instance.  Then you have the Load methods to retrieve it, and the delete methods to remove it. 

    HTH,
    Matt


    Check out Pluralsight On Demand! http://www.pluralsight.com/main/olt/
    Thursday, August 20, 2009 3:32 PM
  • hai matt/Shadew,
    thanks for fruitfull inputs...
    let me try and will update you......

    Regards,
    joyous suhas
    Friday, August 21, 2009 4:58 AM