The best method of contention control is to design it out of your database. Here are a few ideas.
Avoiding generating numeric keys for new records based on the highest number already used unless one the following is true:
The key of the record also includes a component that is guaranteed to be different for another instance of the program. For example an order entry program can use the highest key so far technique for order line numbers if the order header number is allocated via rec_autoinc(). Another common technique, espcially if you intend to use a client-server configuration, is to add a "workstation_id" key to tables where contention between workstations might be a problem.
Avoid doing things like maintaining stock-totals in order entry or sales programs. If you do this two instances of the program will contend when they happen to update the same stock record. Instead get a background program to process new orders to do the stock update. If necessary include a status field in the order line table that indicates the stock needs updating, and update this when the line has been processed. To avoid the inefficiency of constantly polling a table for changes you can use an ADC (Auxiliary Database Controller) that "wakes up" the background program as necessary.