我爱Aspx >> Asp.Net >> COM+ Web 服务:通过复选框路由到 XML Web Services(2) (微软中国)COM+ Web 服务:通过复选框路由到 XML Web Services(2) (微软中国)
事务性组件示例
简单的计算器远算不上工作量繁重的业务应用程序,因此我们现在考虑带有对象池的适于 COM+ 事务性组件的应用程序。
最容易管理和配置的组件是由 ServicedComponent 导出的托管代码组件,如以下 C# 示例所示:using System;using System.Reflection;using System.Runtime.InteropServices;using System.EnterpriseServices;using System.Data;using System.Data.SqlClient;[assembly: ApplicationName("SCTrans")][assembly: ApplicationActivation(ActivationOption.Server, SoapVRoot="SCTrans")][assembly: AssemblyKeyFile("SCTrans.snk")]namespace SCTrans{ public interface ISCTrans { string CountUp (string Key); } [ObjectPooling(MinPoolSize=0, MaxPoolSize=25)] [JustInTimeActivation(true)] [ClassInterface(ClassInterfaceType.AutoDual)] [TransactionAttribute(TransactionOption.RequiresNew)] public class SCTransSQLNC : ServicedComponent, ISCTrans { [AutoComplete] public string CountUp (string Key) { _command = new SqlCommand("", _connection); _command.CommandType = CommandType.Text; _command.Connection.Open(); _command.CommandText = "UPDATE CallCount WITH (ROWLOCK) SET CallCount = CallCount + 1 WHERE Machine=@#" + Key + "@#"; _command.ExecuteNonQuery(); _command.Connection.Close(); _numcalls++; return (_numcalls + " NC " + _guid); } protected override bool CanBePooled() { return true; } private int _numcalls = 0; private string _guid = Guid.NewGuid().ToString(); private SqlConnection _connection = new SqlConnection("user id=MyUser;password=My!Password; database=SoapTest;server=MyServer"); private SqlCommand _command; }}
Ҷƪл˵?
COM+ Web 服务:通过复选框路由到..[05-28]
好的,webservice里能返回datase..[05-28]
在Web Service中实现Transaction[05-28]
Data Integrity in Web Services..[05-28]
Data Integrity in Web Services..[05-28]
很老的文章了,不知道有人贴过没..[05-28]
一并给你回答吧:webservice , s..[05-28]
XML Web Service 基础 (转微软MS..[05-28]
在运行时使用 UDDI (微软)[05-28]
实战Web服务[05-28]
COM+ Web 服务:通过复选框路由到..[05-28]
好的,webservice里能返回datase..[05-28]
在Web Service中实现Transaction[05-28]
Data Integrity in Web Services..[05-28]
Data Integrity in Web Services..[05-28]
很老的文章了,不知道有人贴过没..[05-28]
浅谈SOAP (转)[05-28]
一并给你回答吧:webservice , s..[05-28]
XML Web Service 基础 (转微软MS..[05-28]
在运行时使用 UDDI (微软)[05-28]