Jump to content

Transaction Integrity

Compiere ensures that every transaction can be repeated and regenerated. Transaction failures, while rare, can occur. In most cases these errors are identified by the system immediately. An error causes the system to alert the user, who can attempt to fix the problem. If recovery is not possible, the failed transaction is isolated and the rest of the system continues to work. This "transaction de-coupling" is the basis for Compiere's transaction integrity system.

Transaction Integrity Example

Below is an example of the transaction substructure for a "cash sale of an over the counter product:"

  • Material Transaction (adjust inventory)
    • Generate Material Accounting (for each Accounting Schema)
    • Post
  • Invoice Transaction (calculate tax & create invoice)
    • Generate Invoice Accounting (for each Accounting Schema)
    • Post
  • Receipt Transaction (create receipt for invoice)
    • Generate Receipt Accounting (for each Accounting Schema)
    • Post

To have nine or more transactions rather than one or two may seem like overkill, but it is actually faster and much more reliable than a single transaction approach.

In this example, only two sub-transactions are performed immediately: the material and invoice transactions. If these transactions succeed, the cashier proceeds to the next task. The remaining sub-transactions are scheduled (or optionally batched) and are executed asynchronously. If this particular invoice fails to post, additional invoices can still be generated and sent to customers.

Simplified Recovery

With Compiere, the system checks regularly if a transaction is complete. If a transaction is not complete and consistent due to a system failure, the administrator and user are alerted. If a problem occurs during processing of one of the sub-transactions, that error doesn't stop the cashier from performing additional tasks. An administrator can investigate and resolve the failed transaction independently and asynchronously.

As applications become more complex with ever growing combinations of transactions, potential error causes grow exponentially. In the rare case of an error, Compiere isolates the problem without interrupting Compiere's core functions.