Error When Saving Order Under Azure

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Error When Saving Order Under Azure

Postby SBarnes » Wed Feb 20, 2019 5:58 pm

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
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Error When Saving Order Under Azure

Postby Mike.Sheen » Thu Feb 21, 2019 9:24 am

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?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Error When Saving Order Under Azure

Postby SBarnes » Thu Feb 21, 2019 9:39 am

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?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Error When Saving Order Under Azure

Postby SBarnes » Mon Feb 25, 2019 4:17 pm

We are still getting this error would a second try at saving be an option?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Error When Saving Order Under Azure

Postby SBarnes » Wed Feb 27, 2019 10:43 am

This error is also being reported from the web api on a post of a sales order request.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests