求助!IIS5.1的WebService放到IIS7.5下执行缓慢
VB.NET+ACCESSWebService代码如下:
<WebMethod()> _
Public Function Upload(ByVal strSqls() As String) As Integer '传入参数为需要执行的SQL语句的字符串数组,一条Update语句一条Insert语句。
Dim dbConnection As OleDbConnection = getAccessConnection()
Dim dbCommand As New OleDbCommand
dbCommand.Connection = dbConnection
Dim trans As OleDbTransaction = transBegin(dbConnection)
Dim intSqlIndex As Integer = 0
Dim intResult As Integer = 0
Try
'循环执行执行SQL语句,先执行Update,执行Update返回1行以下时再执行Insert语句。
For i As Integer = 0 To strSqls.Length / 2 - 1
dbCommand.CommandText = strSqls(intSqlIndex)
dbCommand.Transaction = trans
intResult = dbCommand.ExecuteNonQuery()
intSqlIndex = intSqlIndex + 1
If intResult < 1 Then
dbCommand.CommandText = strSqls(intSqlIndex)
intResult = dbCommand.ExecuteNonQuery
intSqlIndex = intSqlIndex + 1
If intResult < 1 Then
trans.Rollback()
dbConnection.Close()
dbCommand.Dispose()
trans.Dispose()
dbConnection.Dispose()
Return -1
End If
End If
intSqlIndex = intSqlIndex + 1
Next
Catch ex As Exception
trans.Rollback()
File.AppendAllText("C:\inetpub\wwwroot\ExteriorEstimateWs" + "\Log.txt", DateTime.Now + " : exception message : " + ex.Message + " ; exception stacktrace : " + ex.StackTrace + " ; sql : " + strSqls(intSqlIndex) + " " + strSqls(intSqlIndex) + " " + Chr(13) + Chr(10))
dbConnection.Close()
dbCommand.Dispose()
trans.Dispose()
dbConnection.Dispose()
Return -1
End Try
trans.Commit()
dbConnection.Close()
dbCommand.Dispose()
trans.Dispose()
dbConnection.Dispose()
Return 1
End Function
在自己机器WIN XP上的IIS5.1上运行速度可以,一秒能执行60条左右。但是把这个WebService放到WIN SERVER 2008的IIS7.5上之后运行速度慢的要死。一秒平均10条以内,查了也没有解决,求大神帮忙。。。
补充:.NET技术 , Web Services