WCF服務編程設計規範(5):事務與並發管理設計

來源:互聯網
上載者:User

今天整理的內容是WCF事務和並發管理相關的設計規範。WCF服務編程設計規範(5):事務與並發管理設計。中英文對照,How to design Transactions and Concurrency Management in WCF Service.

下面一節是佇列服務與安全。

Transactions

事務 

1. Never manage transactions directly.

不要直接管理事務

2. Apply the TransactionFlow attribute on the contract, not the service class.

在契約而不是服務類上標註TransactionFlow屬性,

3. Do not perform transactional work in the service constructor.

不要在服務的建構函式裡執行事務操作

4. Using this book’s terminology, configure services for either Client or Client/Service transactions. Avoid None or Service transactions.

使用本書中的術語,為用戶端或用戶端/服務端事務模式佈建服務。避免使用None或服務事務模式。

5. Using this book’s terminology, configure callbacks for either Service or Service/Callback transactions. Avoid None or Callback transactions.

使用本書中的術語,為服務或服務/回調事務模式配置回調。避免使用None或回調事務模式。

6. When using the Client/Service or Service/Callback mode, constrain the binding to flow transactions using the BindingRequirement attribute.

當使用用戶端/服務或服務/回調模式,通過BindingRequirement屬性約束綁定傳播事務

7. On the client, always catch all exceptions thrown by a service configured for None or Service transactions.

在用戶端,始終捕獲None或服務事務裡拋出的所有異常。

8. Enable reliability and ordered delivery even when using transactions.

即使使用事務的時候,也要啟用可靠性和順序傳遞

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.