1
在我的ASP.NET Web服務中,我已經包含了一個模塊,它們是公共聲明變量。他們會線程安全嗎?同時通話時他們會混淆嗎?ASP.NET Web服務+模塊+公共變量=線程安全嗎?
這些變量大多DatsSet,數據表和SqlDataAdapter的..
模塊的部分代碼:
Imports System.Data.OleDb
Imports System.Diagnostics
Module modCommon
Public bDoLog As Boolean
Public sCurrentODBC As String
Public cn As SqlConnection
Public Query1ds As DataSet
Public Query1 As DataTable
Public Query1adapter As SqlDataAdapter
@scripni
謝謝,因爲我不跟家族性你的建議,我會在本地移動一切。
此外,將以下變量是線程安全的?:
[ToolboxItem(False)]_
Public Class Service1
Inherits System.Web.Services.WebService
Dim sName As String
Dim sCurrentPath As String
[WebMethod()]_
Public Function Capture(ByVal sPath As String) As String
sName = "Joe"
End Function
End Class