Beispiel #1
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="persistentStore"></param>
		/// <param name="mode"></param>
		internal UpdateContext(PersistentStore persistentStore, UpdateContextSyncMode mode)
			: base(persistentStore)
		{
			if (mode == UpdateContextSyncMode.Hold)
				throw new NotSupportedException("UpdateContextSyncMode.Hold is not supported");

			// create a default change-set logger
			_changeSetRecorder = new DefaultEntityChangeSetRecorder();
			_validator = new DomainObjectValidator();
			_validationChangeTracker = new ChangeTracker();
		}
Beispiel #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="persistentStore"></param>
        /// <param name="mode"></param>
        internal UpdateContext(PersistentStore persistentStore, UpdateContextSyncMode mode)
            : base(persistentStore)
        {
            if (mode == UpdateContextSyncMode.Hold)
            {
                throw new NotSupportedException("UpdateContextSyncMode.Hold is not supported");
            }

            // create a default change-set logger
            _changeSetRecorder       = new DefaultEntityChangeSetRecorder();
            _validator               = new DomainObjectValidator();
            _validationChangeTracker = new ChangeTracker();
        }
Beispiel #3
0
        public IUpdateContext OpenUpdateContext(UpdateContextSyncMode mode)
        {
            try
            {
                SqlConnection connection = OpenConnection();

                return(new UpdateContext(connection, _transactionNotifier, mode));
            }
            catch (Exception e)
            {
                Platform.Log(LogLevel.Fatal, e, "Exception when opening database connection for update");

                throw new PersistenceException("Unexpected exception opening database connection for update", e);
            }
        }
Beispiel #4
0
 internal UpdateContext(SqlConnection connection, ITransactionNotifier transactionNotifier, UpdateContextSyncMode mode)
     : base(connection, transactionNotifier)
 {
     _transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);
     _mode        = mode;
 }
        public IUpdateContext OpenUpdateContext(UpdateContextSyncMode mode)
        {
            try
            {
                SqlConnection connection = OpenConnection();

                return new UpdateContext(connection, _transactionNotifier, mode);
            }
            catch (Exception e)
            {
                Platform.Log(LogLevel.Error, e, "Exception when opening database connection for update");

                throw new PersistenceException("Unexpected exception opening database connection for update", e);
            }
        }
Beispiel #6
0
		/// <summary>
		/// Obtains an <see cref="IUpdateContext"/> for use by the application to interact
		/// with this persistent store.
		/// </summary>
		/// <returns>a update context</returns>
		public IUpdateContext OpenUpdateContext(UpdateContextSyncMode mode)
		{
			return new UpdateContext(this, mode);
		}
Beispiel #7
0
 internal UpdateContext(SqlConnection connection, ITransactionNotifier transactionNotifier, UpdateContextSyncMode mode)
     : base (connection, transactionNotifier)
 {
     _transaction = connection.BeginTransaction(mode == UpdateContextSyncMode.Flush ? IsolationLevel.ReadCommitted : IsolationLevel.Serializable);
     _mode = mode;
 }
Beispiel #8
0
 internal UpdateContext(SqlConnection connection, ITransactionNotifier transactionNotifier, UpdateContextSyncMode mode)
     : base(connection, transactionNotifier)
 {
     _transaction = connection.BeginTransaction(mode == UpdateContextSyncMode.Flush ? IsolationLevel.ReadCommitted : IsolationLevel.Serializable);
     _mode        = mode;
 }
Beispiel #9
0
 /// <summary>
 /// Obtains an <see cref="IUpdateContext"/> for use by the application to interact
 /// with this persistent store.
 /// </summary>
 /// <returns>a update context</returns>
 public IUpdateContext OpenUpdateContext(UpdateContextSyncMode mode)
 {
     return(new UpdateContext(this, mode));
 }
Beispiel #10
0
 internal UpdateContext(SqlConnection connection, ITransactionNotifier transactionNotifier, UpdateContextSyncMode mode)
     : base (connection, transactionNotifier)
 {
     _transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);
     _mode = mode;
 }