Re: Row Locked Errors
Posted in 1996
Andrew, Is it possible that you could move the "get next_invoice_no" to the end of the transaction? Failing that, do you have any idea why the transaction sometimes takes > 1 minute? --Craig On Mon, 15 Apr 96 21:52:57 GMT, Andrew Storer <andrew@astorer.demon.co.uk> wrote: }The company I work for has a client/server application - Gupta }front-end connecting to an Informix database. One part of the }application requires that an invoice be created. The processing }goes something like... } begin work } get next_invoice_no from system_counts table } increment next_invoice_no in system_counts table } insert new invoice using next_invoice_no } ..... } < do lots of other inserts/updates> } ..... } if any errors detected above } display appropriate error message } rollback work } else } commit work } endif } }Generally this is OK but sometimes a network or Gupta problem }causes the 'lots of updates' to take a long time (>1 minute when }usually <1 second) which means that a lock remains on the }system_counts table until the problem PC has finished its }transaction and nobody else can update the next_invoice_no. } }Hence, we get 1 phone call 'My PC is going slow' and 20 calls }'I get row locked error'. } }Bearing in mind that: }1. All of the updates must be done in a single transaction }2. We cannot have gaps in the invoice numbers ====================================================================== Craig Kickel | Unix/C/Database Consultant ckickel@cyberhighway.net | <This space intentionally left blank> ======================================================================