Page 1 of 1

Error Posting Wires in Server Package

Posted: Sun Aug 02, 2020 8:09 pm
by mmregan
We wrote a custom service package that programmatically posts wires (that already exist as pending items FYI) using the ITransactionManager.ApplyChanges (after getting an existing transaction from the transaction manager). We are updating the transaction’s status and a few other fields, as shown here:

Code: Select all

using (RuntimeContext.Impersonate())
using (RuntimeContext.Impersonate(RuntimeContext.CurrentSessionToken, true))
...
ITransaction tran = tm.GetTransaction(record.CurrentTransactionID);
wireOutTransaction = tran as IWireOutTransaction;
...
wireOutTransaction.Status = TransactionStatus.Posted;
wireOutTransaction.BankName = currentFundRequest.ReceivingBank.Name;
wireOutTransaction.RoutingNumber = currentFundRequest.ReceivingBank.RoutingNumber;
wireOutTransaction.CreditAccountName = currentFundRequest.Beneficiary.Name;wireOutTransaction.CreditAccountNumber = currentFundRequest.Beneficiary.AccountNumber;wireOutTransaction.BankSequenceNumber = currentFundRequest.WireRef;
wireOutTransaction.FederalReferenceNumber = currentFundRequest.FEDRef;
...
tm.ApplyChanges("Automated Post", wireOutTransaction);
For some wires, and only some, this codes results in the following exception:
The transaction has aborted. - Stack: at System.Transactions.TransactionStateAborted.CreateAbortingClone(InternalTransaction tx)
 at System.Transactions.DependentTransaction..ctor(IsolationLevel isoLevel, InternalTransaction internalTransaction, Boolean blocking)
 at System.Transactions.Transaction.DependentClone(DependentCloneOption cloneOption)
 at System.Transactions.TransactionScope.SetCurrent(Transaction newCurrent)
 at System.Transactions.TransactionScope.PushScope()
 at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption, TransactionOptions transactionOptions, TransactionScopeAsyncFlowOption asyncFlowOption)
 at SoftPro.Select.Service.TransactionHelper.OnNewTransactionScope(TransactionScopeOption scopeOption, TimeSpan scopeTimeout)
 at SoftPro.Select.Server.Enumerations.EnumManager.GetEnum(Int32 id)
 at SoftPro.Select.Server.Enumerations.EnumManager.GetEnum()
 at SoftPro.Select.Client.Enumerations.EnumToValueTypeConverter`1.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
 at SoftPro.EntityModel.Design.EnumToSetTypeConverter`1.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
 at SoftPro.EntityModel.ProxyField`1.ConvertFromFieldValue(Object value)
 at SoftPro.EntityModel.ProxyField`1.get_Value()
 at SoftPro.EntityModel.ProxyField`1.SoftPro.EntityModel.IField.get_Value()
 at SoftPro.EntityModel.Entity`1.SoftPro.EntityModel.IEntity.get_Item(String path)
 at SoftPro.OrderTracking.Client.Orders.OrderInfo..ctor(IServiceProvider site, IOrder order)
 at SoftPro.OrderTracking.Client.Orders.OrderBase`1.SoftPro.OrderTracking.Client.Orders.IOrder.ToOrderInfo()
 at SoftPro.OrderTracking.Server.Orders.OrderStore.SoftPro.OrderTracking.Client.Orders.IOrderStore.CloseOrder(IOrder order)
 at SoftPro.OrderTracking.Client.Orders.OrderBase`1.OnDispose()
 at SoftPro.EntityModel.Entity`1.Dispose()
 at SoftPro.OrderTracking.Client.Orders.OrderBase`1.System.IDisposable.Dispose()
 at SoftPro.Register.Server.RegisterAgent.HandleTransactionSavePrivate(ITransaction transaction, SaveAction action)
 at SoftPro.Register.Server.RegisterManager.SoftPro.Register.Server.IRegisterManager.HandleTransactionSave(ITransaction transaction)
 at SoftPro.Register.Server.Package.HandleAccountingEvent(TransactionEventArgs e, AccountingEventHandler eventHandler)
 at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
 at SoftPro.Accounting.Server.Transactions.TransactionsManager.InvokeTransactionEvent(ITransaction transaction, EventHandler`1 transactionEvent)
 at System.Collections.Generic.List`1.ForEach(Action`1 action)
 at SoftPro.Accounting.Server.Transactions.TransactionsManager.ApplyChanges(String reason, Boolean useIndividualReasons, Boolean postingChecks, Boolean autoCheckNumber, ITransaction[] transactions)
 at SoftPro.Accounting.Server.Transactions.TransactionsManager.SoftPro.Accounting.Client.Transactions.ITransactionsManager.ApplyChanges(String reason, ITransaction[] transactions)


For these failed posts, a user can go into the register via the shell and post the wire without modifying anything other than status. Many transactions do not fail, but some do and I cannot find a common thread at this time.

Version is Select 4.3 but I'm not sure which build (it is NAT production).

Ideas?

Re: Error Posting Wires in Server Package

Posted: Wed Sep 16, 2020 5:09 pm
by BobRichards
We do not know what is going on. In what version did it begin to fail? Does the *same scenario* fail each time or is it random?