开发者

WCF queue and transaction feature

开发者 https://www.devze.com 2023-03-29 00:46 出处:网络
Is there any out of the box support for queueing WCF service request and commiting them in a transaction (server side)? E.g.

Is there any out of the box support for queueing WCF service request and commiting them in a transaction (server side)? E.g.

Begin
Insert
Insert
Delete
Edit
Commit

The comsumer would start the queue/transaction by calling begin, invoking multiple service requests, and committing by calling commit.

Note that this should only tie to the application la开发者_Python百科yer and not the database.

Thanks in advance!


It is possible.

You should use the Sessions and Transaction Flow features of WCF.

With Session, you can control, in which order your operations have to be called within a session, by marking which operation should start a session and which one should end it.

Transaction Flow would keep the transaction you create in Client side carried over to the server side and will maintain it.

You may refer to Enabling Transaction Flow, WCF Transaction Propagation, and Sessions, Instancing and Concurrency for more detail.

However, I am not sure how you would untie an application transaction from data layer. It won't make sense to keep an application transaction that wouldn't have control on database transaction.

0

精彩评论

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

关注公众号