【发布时间】:2011-05-16 03:44:20
【问题描述】:
我在 Azure 中托管了一个 ASP.NET Web 应用程序。有趣的是,有时应用程序会在数据库中创建两条记录。
任何人都可以确认我是否在下面做任何愚蠢的事情吗? 存储库 sn-ps:
private SomeEntity entities = new SomeEntity ();
public void Add(SomeObject _someObject)
{
entities.EmployeeTimeClocks.AddObject(_someObject);
}
public void Save()
{
entities.SaveChanges();
}
创建sn-ps:
repo.Add(someObject);
repo.Save();
注意:我正在使用 SQL Azure 进行持久存储。
我有这个 JQuery 来显示加载,这可能是导致这个问题的原因吗?
$('#ClockInOutBtn').click(function () {
jQuery('#Loading').showLoading(
{
'afterShow': function () { setTimeout("$('form').submit();", 2000) }
}
);
});
【问题讨论】:
-
看起来不错。有时是什么意思?
-
从'empTimeClock'进来?
-
谢谢@Pert,我已经更新了问题。应该是_someObject。
-
看起来这会导致问题? $('#ClockInOutBtn').click(function () { jQuery('#Loading').showLoading( { 'afterShow': function () { setTimeout("$('form').submit();", 2000 ) } } ); });
-
@jfar,它似乎在调试模式下发生。
标签: asp.net-mvc azure