Page 1 of 1

Error When Saving Order Under Azure

PostPosted: Wed Feb 20, 2019 5:58 pm
by SBarnes
We are getting the following error when saving an order from a windows service under Azure, do you have any idea besides lost connection to the database that could possibly cause this?

Code: Select all
2019/02/20 13:10:07.872:  Error Exception Unable to insert into SY_Numbers
 Error Stack Trace   at JiwaFinancials.Jiwa.JiwaApplication.Manager.GetSystemNumber(String TargetModuleDescription)
   at JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder.iSave(Boolean SavingForPrint, Boolean SavingForSplit)
   at JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder.iSave()
   at JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance.Save()
   at WOrderQueue.JiwaWebOrderProcessor.ImportOrderForBasket(JESO_Basket basket, List`1 lines, String& InvoiceNo, String& ErrorMsg) in C:\attkey\WOrderQueue\WOrderQueue\JiwaWebOrderProcessor.cs:line 526

Re: Error When Saving Order Under Azure

PostPosted: Thu Feb 21, 2019 9:24 am
by Mike.Sheen
SBarnes wrote:We are getting the following error when saving an order from a windows service under Azure, do you have any idea besides lost connection to the database that could possibly cause this?


That error is a little misleading - it might not be an insert into SY_Numbers failing - it might also be an update to SY_Numbers.

An update failing is more likely than the insert, as with the update we include some concurrency control via the LastSavedDateTime of the SY_Numbers record.

So - it looks like someone else has created as sales order in between the time the SY_Numbers table was read and the update performed.

The update looks like this
Code: Select all
UPDATE SY_Numbers
SET LastInvoiceNo = @LastInvoiceNo, LastSavedDateTime = @NewLastSavedDateTime
WHERE InvoiceNumberID = @InvoiceNumberID
AND LastSavedDateTime = @LastSavedDateTime


This is performed almost immediately after the read - so either you were really unlucky or something had blocked your process long enough for another update to occur to SY_Numbers.

Is there a fairly high throughput of sales orders created in this environment?

Re: Error When Saving Order Under Azure

PostPosted: Thu Feb 21, 2019 9:39 am
by SBarnes
Hi Mike,

There is a reasonably high through put about 300 orders a day, interestingly the same program connects to the database using the Entity Framework to work with non Jiwa tables and when this occurred an entry did make it to the failure log table.

The next process run a couple of minutes later where Jiwa had been logged off from and logged onto again went through without a hitch.

Would trying the save a second time on the same sales order object be the best work around?

Re: Error When Saving Order Under Azure

PostPosted: Mon Feb 25, 2019 4:17 pm
by SBarnes
We are still getting this error would a second try at saving be an option?

Re: Error When Saving Order Under Azure

PostPosted: Wed Feb 27, 2019 10:43 am
by SBarnes
This error is also being reported from the web api on a post of a sales order request.