locked
a non-serializable object type can only be declared within an atomic scope or service RRS feed

  • Question

  • Hi 

    In my orchestration there is one enter shape where i am trying to refer one pipeline component like this

    Pipeline = Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline(typeof(ABC.BizTalk.Template.Pipelines.ABCSSOESBReceiveXml),msgOut);
    Pipeline.MoveNext();

    but when i am trying to build it gives me the following exception 

    a non-serializable object type 'Microsoft.XLANGs.Pipeline.ReceivePipelineOutputMessages Pipeline' can only be declared within an atomic scope or service

    Thanxs

    Monday, December 12, 2016 7:20 AM

Answers

  • Like I have mentioned before you have to use atomic scope. To execute the receive pipeline we have to keep the scope of the expression shape as atomic because the pipeline can be executed in the atomic shape. Carefully examine your solution again. Refer: https://abdulrafaysbiztalk.wordpress.com/2008/08/10/calling-send-and-receive-pipelines-from-the-orchestration-expression-shapes/

    Rachit Sikroria (Microsoft Azure MVP)

    Monday, December 12, 2016 9:05 AM
    Moderator

All replies

  • BizTalk is entirely Stateless. This is achieved by using Persistence Points. In case of any failure during the processing of an Orchestration (for e.g.: power failure or Server Restart etc) BizTalk Server will continue to restart the Orchestration from the last Persistence Point. Details about the Persistence points will be Stored in BizTalk SQL Server Database by serializing all the data. Hence Non-Serializable Classes or Types cannot be used directly in Orchestrations. You can use Non – Serializable Classes or Types inside Atomic Scopes in an Orchestration. Please go through below tutorial for more details. http://masteringbiztalkserver.wordpress.com/2011/01/20/can-we-use-non-serializable-classes-or-types-in-an-orchestration/

    Rachit Sikroria (Microsoft Azure MVP)


    Monday, December 12, 2016 8:15 AM
    Moderator
  • Hi Rachit

    I tried the steps mentioned in this blog but its not working for me.Still facing the same issues.

    In my orchestration flow is like

    1) One receive shape in the start
    2) One scope
    3) Inside that one group
    4) Inside that one more scope
    5) Inside that one enter shape which is referring to that pipeline component.

     

    Monday, December 12, 2016 8:42 AM
  • Hi

    Since the pipeline type is not serializable, you have to wrap the Expression Shape in an Atomic Scope.

    Refer-

    A variable of type ReceivePipelineOutputMessages can be declared only within an atomic scope in an orchestration. This is because variables of this type are not serializable and thus would not survive persistence of the orchestration, and orchestrations are never persisted while executing within an atomic scope. This means that a receive pipeline can be executed only within an atomic scope.

    https://msdn.microsoft.com/en-us/library/aa562035.aspx

    https://social.msdn.microsoft.com/Forums/en-US/a63fc9ed-3391-404b-a55b-42946bcda170/an-atomic-scope-may-not-contain-or-call-a-service-or-scope-that-contains-both-the-send-and-the?forum=biztalkgeneral


    Thanks Arindam


    Monday, December 12, 2016 8:56 AM
    Moderator
  • Like I have mentioned before you have to use atomic scope. To execute the receive pipeline we have to keep the scope of the expression shape as atomic because the pipeline can be executed in the atomic shape. Carefully examine your solution again. Refer: https://abdulrafaysbiztalk.wordpress.com/2008/08/10/calling-send-and-receive-pipelines-from-the-orchestration-expression-shapes/

    Rachit Sikroria (Microsoft Azure MVP)

    Monday, December 12, 2016 9:05 AM
    Moderator