RefreshRegistry and UpdateRegistry | Command execution


12.1.5 Database operations

One common coding practice than can lead to deadlocks is to avoid deleting rows and inserting rows within a single transaction. Deleting a row and inserting a row in the same transaction will potentially cause the database to lock the table, reducing concurrency and introducing the potential for more deadlocks.

IBM recommends restructuring the code to avoid such a situation. One technique that can sometimes be used, depending on the data involved and how it is used by the business logic, is to define a recycler class that can delay deletion of operational data until the end of the transaction, in case the object can be re-used simply by changing some of its attribute values, thus avoiding a delete operation followed by an insert operation.
xxxx