日期:2014-05-17 浏览次数:20455 次
#region 插入一条Channel信息 public int SaveChannelInfo(EPGChannelInfo channelInfo) { int channelID = 0; using (ITransaction tx = _isession.BeginTransaction()) { try { channelID=_isession.Save(channelInfo); tx.Commit(); return channelID; } catch (HibernateException) { tx.Rollback(); tx.Dispose(); throw; } } } #endregion
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;BEGIN TRANSACTION exec sp_executesql N'INSERT INTO TABLE .........(此处SQL省略) COMMIT TRANSACTION
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;BEGIN TRANSACTION exec sp_executesql N'INSERT INTO TABLE .........(此处SQL省略) IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION