Row Locked Errors
Posted in 1996
Topics: Stored Procedures & SPL, Transactions, Locking & Isolation
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 Does anybody have any suggestions? Thank you in advance. Andrew Storer