Answered Using QueryTemplate XML

  • Monday, September 28, 2009 9:54 PM
     
     
    I've been experimenting with QueryTemplate XML.   Serialising a QueryTemplate is no problem via the QueryTemplate.Definition property.   I assume that Application.CreateQueryTemplate expects this same format when XML is passed via an XMLReader.   However, I can't get CreateQueryTemplate to work.   It throws an InvalidFormat exception every time.   Obviously I'm just using XML that I've obtained via QueryTemplate.Definition.   Is this a bug in the current CTP, or have I missed something?
    Charles Young

All Replies

  • Monday, September 28, 2009 11:08 PM
     
     Answered
    OK, solved my own problem.

    Because I was simply experimenting, my call to Application.CreateQueryTemplate was trying to create a second QueryTemplate in the same server instance as the one that contained my original QueryTemplate.   In other words, I was trying to create a second identical QueryTemplate in the same Server instance.   StreamInsight doesn't like that at all!  The error has to do with trying to add a duplicate key to a SortedDictionary somewhere deep in InMemoryMetadataProvider.

    If you serialise a QueryTemplate in one Server instance, you must deserialise it into another.   Makes perfect sense, but the error message wan't much help.
    Charles Young
  • Friday, October 02, 2009 11:29 PM
     
     
    Hi Charles,

    The next CTP will have a more explicit error message for duplicate objects so hopefully you will not run into this problem again.
    Regards, Ciprian Gerea SDE, MS StreamInsight Team Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights.