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?