gravatar

ADFbc commit phase information

Many times it will be useful to understand what happens during the commit phase in ADFbc. It is very much useful to know when the validation happens, when the post changes happen etc..

The following sequence happens when a commit is successful.

  1. Validation phase : During this phase all the entities which are marked as modified are validated.
  2. Post changes phase: This is the phase where changes from the middle tier will be pushed to the database but will not be commited. This phase consists of two things


    • Lock phase: Where each row that has to be updated will be locked in the database.
    • Prepare for DML phase:  This is the place where you can modify the values of any entity attribute,if you want to before the changes are posted.
    • Do DML phase: Where the actual dml statement is fired.


  3. Commit Phase: When all the above phases are executed without any problem, the commit happens in this phase.
The following are the EntityImpl methods which will be called in the above phases.


  • Validation Phase: validateEntity()
  • Post changes Phase : postChanges(TransactionEvent e)
  • Lock Phase: lock()
  • Prepare for DML: prepareForDML(int operation,TransactionEvent e)
  • Do DML phase: doDML(int operation, TransactionEvent event)
  • After Posting is done: donePostingAll(TransactionEvent transactionEvent) 
  • Before Commit: beforeCommit(TransactionEvent transactionEvent)
  • After Commit: afterCommit(TransactionEvent transactionEvent)