示例#1
0
        protected void HandleOptimisticLockingException(DbOperation dbOperation)
        {
            bool isHandled = false;

            if (optimisticLockingListeners != null)
            {
                foreach (IOptimisticLockingListener optimisticLockingListener in optimisticLockingListeners)
                {
                    //if (optimisticLockingListener.EntityType == null || optimisticLockingListener.EntityType.IsSubclassOf(dbOperation.EntityType))
                    if (optimisticLockingListener.EntityType == null || dbOperation.EntityType.IsSubclassOf(optimisticLockingListener.EntityType))
                    {
                        optimisticLockingListener.FailedOperation(dbOperation);
                        isHandled = true;
                    }
                }
            }

            if (!isHandled)
            {
                throw pLog.ConcurrentUpdateDbEntityException(dbOperation);
            }
        }