Error: “A correlation may be initialized only once”

I have seen this error in two situations.

1. You have two receive or two send shapes that both initialize the same correlation set. This one is easy to figure out. In my case, I have two points in a single orchestration where I wanted to send a reject message to the same port. I ended up naming the correlation set for the first send shape “rejectProperties” and the second “rejectProperties2,” and both were of the same correlation type.

2. The second situation was not intuitive. My send shape was in a loop, and the compiler interpreted that to mean that there was the potential of initializing the correlation set for that send shape multiple times. The way around this was to put my send shape in a scope (I used a non-transactional scope). I then created the correlation set as local to the scope rather than on the global orchestration level.

This entry was posted in biztalk. Bookmark the permalink.

4 Responses to Error: “A correlation may be initialized only once”

  1. Bergius says:

    Hi Adam! The second solution was just what I looking for. I have a dummy correlation set on a send shape to make some properties to be promoted. I “repost” my message to the message box to see if its “parent message” is on its way.

  2. Anonymous says:

    I found this site using [url=http://google.com]google.com[/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

    Sorry for offtopic

  3. Klas says:

    Nice.

    I had this problem for a send shape in an exception handler. The exception handler itself was not inside a loop (it was global for the orchestration), but one throw exception shape was. Apparently the compiler thought that it was somehow possible that the exception handler could be run multiple times. Solution 2 solved the problem.

    Thanks!

  4. Iti Sharma says:

    Thanks for the solution. It really worked. I am able to promote properties in context in Orch1 But, I need to read these promoted properties in another orchestration, Orch2 in the same solution. This is how am reading the property: msgId = Msg_DmsUp_In(STOLT_STC_DMSUP_SCHEMA.MessageID);
    But, this is giving error: Inner exception: There is no value associated with the property ‘STOLT_STC_DMSUP_SCHEMA.MessageID’ in the message.

    Exception type: MissingPropertyException
    Source: Microsoft.XLANGs.BizTalk.Engine
    Target Site: System.Object GetPropertyValueThrows(System.Type)
    The following is a stack trace that identifies the location where the exception occured

    at Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage.GetPropertyValueThrows(Type propType)
    at STOLT_STC_DMSUP_BTS.STC_DMSUP_BTS_ProcessFile.segment1(StopConditions stopOn)
    at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

    Please help!

    Thanks in anticipation.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>