在我的网页中添加记录时,会多次添加一些记录。然后我发现相同的数据库调用不止一次发送(分析时)。不仅仅是那个SP,还有一些其他的SP。但他们只是返回数据。所以他们不会造成任何问题。但是此行为仅在生产站点中保留。不在开发现场。因此,很难追踪SP呼叫的来源。我检查了循环和东西,但没有。为什么多次触发同一个存储过程调用
下面是在JavaScript文件中的HTTP请求:
var strParams = "?";
strParams += "Process=" + "assignQuestion";
...
strParams += "&measure=" + measure;
xmlAssignQuestion = new ActiveXObject("Microsoft.XMLHTTP");
xmlAssignQuestion .onreadystatechange = assignQuestionBack;
xmlAssignQuestion .open("POST", "AssignQuestion.reliability" + strParams, false);
xmlAssignQuestion .send();
这里是HTTP处理程序
if (process.Equals("assignQuestion"))
{
int measure = int.Parse(context.Request.QueryString["measure"]);
string ret = DBClasses.AssignToGroup.storeQuestionp(measure);
if (long.Parse(ret) == -1)
context.Response.Write("f");
else context.Response.Write(ret);
context.Response.Flush();
context.Response.End();
}
提前
谢谢!
你可以发布profiler dump screen吗? – Raymund 2012-03-13 02:01:19
使用fiddler进行调试来监控网络流量,并确保没有发送重复的http请求。 – gilly3 2012-03-13 02:36:13
你确定你的用户没有多次点击提交按钮吗?如果他们是你可以随时写一些JavaScript代码来防止它。 – 2012-03-13 02:39:46