Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two types of SPs confused
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Two types of SPs confused
Miscellaneous
Thread ID:
00854139
Message ID:
00854139
Views:
46
To All,

Happy Thanksgiving.

I really hope someone has seen this occur before, since I really do not know what to do here.

I have a tcp/ip server program that I've tested extensibly, and if I put a breakpoint at 119 it will never be hit unless I put 10 clients messaging with the server. Then there is a problem almost immediately. The problem is that under this high load of 10 clients hitting the server every 1/2 second:
line 107 shows me that dalrequest.command = "pr_step_updatecompleteness"
, but
ocmd.commandtext = "pr_step_selectlast"
This doesn't make sense that ocmd.commandtext could change between lines
107 and 116, and I can't even find a way to trace since it only happens Rarely.

This is bad because we will have the wrong number of parameters, and we are executing a query with a nonquery.
e.message = "Too many arguments specified for pr_step_selectlast"
pr_step_selectlast expects one input and pr_step_updatecompleteness expects two inputs.
pr_step_selectlast was the last stored procedure run, so why is it getting confused with the current stored procedure = pr_step_update completeness?

On a different run it will confuse two other consecutive SPs similarly, with maybe an update trying to be run inside a dataadapter fill routine.

This confusion has never happened to me except in this one server many clients = 10 context.

Does anyone know what is happening here and how to avoid it? I need about 100 clients to work here.

Thanks,

100 Public Overloads Overrides Sub Execute()
101 Dim oCmd As SqlCommand = New SqlCommand()
102 Dim oEnumerator As IEnumerator = m_oParmList.GetEnumerator()
103 Try
104 Me.Connection.ConSql.Open()
105 With oCmd
106 .Connection = Me.Connection.ConSql
107 .CommandText = DalRequest.Command
108 .CommandType = DalRequest.CommandType
109 End With
110 If DalRequest.CommandType = CommandType.StoredProcedure Then
111 Do While (oEnumerator.MoveNext())
112 Dim oP As Parameter = oEnumerator.Current
113 oCmd.Parameters.Add(ConvertParameterToSqlParameter(oP))
114 Loop
115 End If
116 oCmd.ExecuteNonQuery()
117 Catch e As SqlException
118 dim error as string = e.message
119 dim x as string = "nothing but a convenient breakpoint line"
120 Finally
121 Me.Connection.ConSql.Close()
122 End Try
123 End Sub
Next
Reply
Map
View

Click here to load this message in the networking platform