开发者

Compiled query in a static method used by biztalk

I am having a orchestration which will call a static method in a static class. I just discovered that if you need to run a Linq query a lot of times i开发者_JAVA百科t is a good idea to make it into a compiled query. And my orchestration will be spawned a lot of times.

But im not sure I will win anything by making it into a compiled query.

Will each orchestration has to compile the query or will it be shared?


Each orchestration will execute on it's own thread so each orchestration will have it's own copy of the method's local variables including the linq query. So the query will be compiled every time the method is called.

Not sure how you can get around this, because the lifetime of the static class is determined by the lifetime of the orchestration. You could implement a singleton orchestration which could then call a non-static method. That way you could have the first call compile the query and all subsequent calls use the same query.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜