ef 事务

var tran = ef.Database.BeginTransaction();
            try
            {
                ef.SaveChanges();
                tran.Commit();
            }
            catch (Exception ex)
            {
                tran.Rollback();
                LogHelper.Error("OrderInfoEntity表保存异常:" + ex.Message);
                //throw ex;
            }

你可能感兴趣的:(java,数据库,mysql)