In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is WCF transaction". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what WCF transaction is.
There are many ways to communicate between two applications, for example, we can use XML to communicate with Webservice, use messages to communicate with MSMQ, use XML or binary streams to communicate with .NetRemoting, and so on.
But if an application needs to use all of these functions at the same time, it will bring considerable trouble to maintenance. The emergence of WCF unifies this situation. What is WCF? WCF simplifies the development of associated applications through a new service-oriented programming model. By providing a hierarchical architecture, WCF supports multiple styles of distributed application development. The WCF channel architecture provides asynchronous untyped messaging primitives at the underlying level. Based on this, there are various protocol functions for secure and reliable transaction data exchange, as well as a wide range of transmission protocols and coding options. WCF transactions are originally difficult to implement, but WCF can always turn decay into magic. It can implement distributed WCF transactions through simple declarative programming. Let's take a look at the contributors to this goal:
1) TransactionFlowAttribute: an attribute of the operation contract (OperationContractAttribute) that indicates the transaction option (TransactionFlowOption) of the Operation to which it belongs.
2) TransactionFlowOption: it is a parameter in the TransactionFlowAttribute constructor and is an enum, including three enumerated items NotAllowed: transaction is not allowed, which is the default; Allowed: transaction is allowed, which means transaction is optional; Mandatory: mandatory transaction, indicating that transaction is necessary.
3) TransactionAutoCompleteOnSessionClose: it is an attribute of OperationBehaviorAttribute, which is used to indicate whether the server instance is automatically released after the transaction is completed. This attribute is closely related to the service object instance pattern. You should be careful when using it, as explained below.
4) TransactionIsolationLevel: also an attribute of OperationBehaviorAttribute, indicating transaction isolation mode (isolation level). Including 5 options: Any,ReadUncommitted,ReadCommitted,RepeatableRead,Serializable, the knowledge related to transaction isolation is more complex, which will be described in detail in the second point of the article.
5) TransactionTimeout: it is also an attribute of OperationBehaviorAttribute, which is used to indicate the timeout of the transaction. The default is TimeSpan.Zero, which means that it will not be limited by the timeout.:: OperationBehaviorAttribute: is also an attribute of OperationBehaviorAttribute that indicates the distributed transaction option. If set to true, it must be within the transaction scope (Transaction Scorp).
Through the use of the above attributes, we can easily implement transactions and distributed transactions in WCF.
Thank you for your reading, the above is the content of "what is WCF transaction", after the study of this article, I believe you have a deeper understanding of what WCF transaction is, and the specific use needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.