Пример #1
0
 /// <summary>
 /// Commits the transaction.
 /// </summary>
 /// <remarks>
 /// After a successful call to this method, this context instance should be disposed.
 /// </remarks>
 public void Commit()
 {
     try
     {
         if (_transactionCommitted)
         {
             throw new InvalidOperationException("Transaction already committed.");
         }
         _context.SubmitChanges();
         if (_transaction != null)
         {
             _transaction.Commit();
         }
         _transactionCommitted = true;
     }
     catch (ChangeConflictException)
     {
         foreach (ObjectChangeConflict occ in _context.ChangeConflicts)
         {
             MetaTable metatable = _context.Mapping.GetTable(occ.Object.GetType());
             Platform.Log(LogLevel.Warn, "Change Conflict with update to table: {0}", metatable.TableName);
         }
         throw;
     }
 }