Esempio n. 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();
		}
Esempio n. 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();
        }
Esempio n. 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);
            }
        }
Esempio n. 4
0
 internal UpdateContext(SqlConnection connection, ITransactionNotifier transactionNotifier, UpdateContextSyncMode mode)
     : base(connection, transactionNotifier)
 {
     _transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);
     _mode        = mode;
 }
Esempio n. 5
0
        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);
            }
        }
Esempio n. 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);
		}
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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));
 }
Esempio n. 10
0
 internal UpdateContext(SqlConnection connection, ITransactionNotifier transactionNotifier, UpdateContextSyncMode mode)
     : base (connection, transactionNotifier)
 {
     _transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);
     _mode = mode;
 }