Exemplo n.º 1
0
 //attributed.AttributedMetadataModule
 //public void Testing()
 //{
 //    Debug.WriteLine("Jekkkkkk");
 //}
 public Transaction4LogicAttribute()
 {
     this.settings = new TransactionAttributeSettings();
 }
Exemplo n.º 2
0
        protected virtual object CloseUnitOfWork(
          TransactionAttributeSettings transactionAttributeSettings, object transactionState, Exception err)
        {
            
            if (err == null)
            {
                try
                {
                    _session.Flush();
                    transactionState = this.transactionManager.CommitTransaction( transactionState);
                }
                catch (Exception)
                {
                    transactionState = this.transactionManager.RollbackTransaction( transactionState);
                    transactionState = this.transactionManager.PopTransaction(transactionState);
                    throw;
                }
            }
            else
            {
                transactionState = this.transactionManager.RollbackTransaction( transactionState);
            }

            transactionState = this.transactionManager.PopTransaction( transactionState);

            return transactionState;
        }
Exemplo n.º 3
0
 private object OnSuccess(TransactionAttributeSettings transactionAttributeSettings, object transactionState)
 {
     return this.CloseUnitOfWork(transactionAttributeSettings, transactionState, null);
 }
Exemplo n.º 4
0
        private TransactionAttributeSettings GetTransactionAttributeSettings(
            ITransactionAttributeSettings[] methodAttributes, ITransactionAttributeSettings[] classAttributes)
        {
            var transactionAttributeSettings = new TransactionAttributeSettings();
            if (methodAttributes.Length > 0)
            {
                transactionAttributeSettings = methodAttributes[methodAttributes.Length - 1].Settings;
            }
            else if (classAttributes.Length > 0)
            {
                transactionAttributeSettings = classAttributes[classAttributes.Length - 1].Settings;
            }

            return transactionAttributeSettings;
        }
Exemplo n.º 5
0
 private object OnEntry(TransactionAttributeSettings transactionAttributeSettings, object transactionState)
 {
     return this.transactionManager.PushTransaction(transactionState);
 }