Castle.ActiveRecord.ActiveRecordBase.InternalUpdate C# (CSharp) Метод

InternalUpdate() приватный статический Метод

Persists the modification on the instance state to the database.
private static InternalUpdate ( object instance, bool flush ) : void
instance object The ActiveRecord instance to be updated on the database
flush bool if set to true, the operation will be followed by a session flush.
Результат void
		private static void InternalUpdate(object instance, bool flush)
		{
			if (instance == null) throw new ArgumentNullException("instance");

			EnsureInitialized(instance.GetType());

			ISession session = holder.CreateSession(instance.GetType());

			try
			{
				session.Update(instance);

				if (flush)
				{
					session.Flush();
				}
			}
			catch (ValidationException)
			{
				holder.FailSession(session);

				throw;
			}
			catch (Exception ex)
			{
				holder.FailSession(session);

				throw new ActiveRecordException("Could not perform Update for " + instance.GetType().Name, ex);
			}
			finally
			{
				holder.ReleaseSession(session);
			}
		}