locked
Initial State Partner- ServiceTutorial3 RRS feed

  • Question

  • Hi

    I am trying to understand how do I create a new XML file with an initial state for a service, cause I want to try the  InitialStatePartner attribute?

    In addition I did not understand why do I need to use this code before the base.start() method:

     

    if (_state == null)

    {

    _state = new ServiceTutorial3State();

     

    my InitialStatePartner looks like that:

    [InitialStatePartner(Optional = true, ServiceUri = "store/ServiceTutorial3.xml")]

    And if Iam using the "true" I thought that using the "If" will be unnecessary?

    help....? Thanks,

    Mendi. 

    Wednesday, February 6, 2008 6:24 PM

Answers

  • A service has only one state document. See other posts on this forum for how to manually save any type of C# data contract class, using our mountpoint service (search for Mountpoint, SaveState, etc).

     

    For data logging, our DSS user guide explains how to modify the dsshost.exe.config file to enable full logging of all messages to/from all service instances in the node

     

    Wednesday, February 6, 2008 8:11 PM

All replies

  • Two options:
    1. Use the dss manifest editor to instantiate a new initial state and associate it with the manifest.
    2. Add a base.SaveState(_state); call to your service in the Start() method, once the state is initialized.  This is the safer bet for services that have complex state initialization.

    R

    Wednesday, February 6, 2008 7:34 PM
  • Thanks a lot, thats helped.

    If I am using the base.save() method I can save only one state... Do you know how to save multiply States..

    DataLogging??

    Thanks a lot.

    Mendi.

    Wednesday, February 6, 2008 8:08 PM
  • A service has only one state document. See other posts on this forum for how to manually save any type of C# data contract class, using our mountpoint service (search for Mountpoint, SaveState, etc).

     

    For data logging, our DSS user guide explains how to modify the dsshost.exe.config file to enable full logging of all messages to/from all service instances in the node

     

    Wednesday, February 6, 2008 8:11 PM