In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the example analysis about the operation of WCF things. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
TransactionFlow (TransactionFlowOption.Mandatory) is specified, but Binding does not set TransactionFlow to true. At this time, at least one operation on the "Bank" contract is configured to set the property to "mandatory", but the binding "WSDualHttpBinding" of the channel is not configured with TransactionFlowBindingElement. The TransactionFlowAttribute property set to mandatory cannot be used without TransactionFlowBindingElement. Error prompt for WCF transaction operation.
The operation of [OperationBehavior (TransactionScopeRequired=true)] is set but not executed in TransactionScorp. An exception similar to "Service operation requires transaction to become a flow" occurs. The screenshot is as follows:
Perhaps the above two questions are not a problem, then this point really needs the attention of our R & D personnel, otherwise we will suffer a lot of losses. This point involves the connection between transaction and service instance pattern. By learning WCF from theory to practice: instance pattern and object life cycle, we have learned that instances will not be created and died out every time under PerSession or Single mode. This is indeed an indisputable truth, but it is challenged here that you can write a program, even if you use your most assured Single mode. At that time, doesn't it mean that the service instance is created once and can be used for life? Let's take a look at the running results after writing a sample program for the next time. I define Bank as follows
But during the call, I found a strange problem. Theoretically, the Bank service instance should only be created once, but the runnable screenshot is as follows:
Is this result a great disappointment to everyone? This is because the service that implements the transaction is also limited by TransactionAutoCompleteOnSessionClose. By default, this property is true, which indicates that the service instance is forced to be destroyed after the completion of the WCF transaction operation, which is equivalent to calling the Dispose () method of the service to release, even though neither PerSession nor Single can escape its law. If you want to maintain the instance mode, you can set it to false, and the effect can be changed as expected that the consistent effect is no longer given.
This is the end of this article on "sample analysis of the operation of WCF things". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.