Order Locking Issues

Discussions related to custom development with Select.
Post Reply
Brian.Snavely
Posts: 18
Joined: Tue Jan 29, 2013 12:06 pm

Order Locking Issues

Post by Brian.Snavely »

In the API, if I try to post a pending receipt to an incoming wire and apply the funds to closing while a user is in the order, I get an exception stating that "user X is in the file" which makes it read-only. The same goes for applying the funds to a wire to a HUD line.

Is there any way to override this functionality as we would like to make these updates while a user is in the order, but not in the register itself?
Brian.Snavely
Posts: 18
Joined: Tue Jan 29, 2013 12:06 pm

Re: Order Locking Issues

Post by Brian.Snavely »

Actually, I'm receiving an order lock issue when I just try to post an incoming wire and not even using the apply towards.

The following code will not let me post the pending receipt as it throws an exception saying I have the order locked when I try to apply the changes

Uri uri = new Uri("http://localhost:8080");
NetworkCredential creds = new NetworkCredential("admin", "Passw0rd", "[SERVER]");

//connect to server and authenticate
SelectServer sps = new SelectServer(uri, creds);

sps.EnsureAuthenticated();

ILedgersManager ledgersManager = sps.GetService<ILedgersManager>();
ILedgerInfo ledgerInfo = ledgersManager.Ledgers.Where(i => i.Name == textBox2.Text).Single();
ILedger ledger = ledgersManager.GetLedger(ledgerInfo);


ITransactionsManager txMgr = sps.GetService<ITransactionsManager>();
TransactionIdentifier txid = new TransactionIdentifier(new Guid(textBox1.Text));
ITransactionInfo txinfo = txMgr.Transactions.Where(i => i.Ledger.ID == ledger.ID)
.ToList()
.Where(i => i.ID.Guid == txid.Guid).ToList().Where(i => i.IsCurrent == true)
.Single();
txMgr.ChangeType(txinfo, TransactionKind.IncomingWire);


IWireInTransaction tx2 = (IWireInTransaction)txMgr.GetTransaction(txinfo);

tx2.BankSequenceNumber = "12345";

tx2.FederalReferenceNumber = "654321";

tx2.Status = SoftPro.Accounting.Client.Transactions.TransactionStatus.Posted;

txMgr.ApplyChanges("WMA", tx2);
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: Order Locking Issues

Post by John Morris »

Order locks cannot be bypassed. You'll need to code defensively for that scenario and try again later.
John Morris
Sr. Software Architect
SoftPro
Brian.Snavely
Posts: 18
Joined: Tue Jan 29, 2013 12:06 pm

Re: Order Locking Issues

Post by Brian.Snavely »

However we are updating the ledger and not the order as I am not making any calls to the order itself, just to the transaction manager.

In Boylon there was an order lock and a ledger lock and we would only post if the ledger was not locked.

We are wanting the same functionality in Cameron.
sindrapal
Posts: 42
Joined: Tue Oct 14, 2008 9:21 am

Re: Order Locking Issues

Post by sindrapal »

Brian,

If it is a proform-generated transaction you are trying to update, PGT rules will run to keep the order and the ledger (transactions) in sync. PGT rules also run when an order is saved. There are several scenarios when PGT rules acquires a lock on the order (Ex. SendToHUD\EMD). My guess is that this is exactly what happened in your case. I would always check if the order is currently locked before updating a generated transaction and re-try the transaction update later.

You probably didn't run into this issue in Boylan because you were posting the transactions in the database directly.
Post Reply