Some experienced note of bugs

1. One exception can cause a nother DB blocking issue,

when use NH, if below code:

NHibernateProvider.Save(new class());
string str = string.empty.
srt = str.SubString(2);
NHibernateProvider.Commit();
A out of range exception will be threw after the transaction began ( if you already begin the transaction in the session begin ) but before the commit, so the transaction will never be end, and it hanges up and unfortunately it block others.
2. if you use QA connectionstring on PROD, it is definately an error.
3. coding standard, especially you are handling a loop.
liek:
foreach(i=0;i<count;i++)
{
if(condition)
{
if(i == number -1)
{
indicator = true;
}
}
}
if (indicator)
{}
actually, the indicator should be true once one of the condition is true, in above loop you may miss the change to update the indicator's value, if in a turn that when i == number -1 the condition is false.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值