在WebService里使用事务处理非常简单,就是在声明WebMethod时加入TransactionOption=TransactionOption.RequiresNew就可以了,
即把以前的[ WebMethod]换成[ WebMethod(TransactionOption=TransactionOption.RequiresNew)]就可以了.
TransactionOption.RequiresNew:请求一个新的事务
Required:需要事务
Supported\NotSupported\Disabled:说明WebMethod方法不在事务范围内运行,单处理请求时,将在没有事务的情况下使用WebMethod方法,具体的区别现在我也还不太清除,希望清楚的朋友指教一下,本人无限感激.
posted on 2007-07-11 23:30  过江  阅读(492)  评论(0编辑  收藏  举报