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)

gravatar

Executing commands in sub shell

Normally, a shell script is nothing but a series of commands to be executed. Some commands open up a sub shell and will prevent the remaining commands in the script from getting executed..

To run such commands in the sub shell opened by the command use the
-exec option..

For example when you use the ADE commands like

ade useview view_name

a new subshell will be created..In this new sub shell, if you want to run any command, do the following..

Create a new shell script which contains all the commands to be executed in the sub shell ..for example

subshellcommands.sh
------------------------
ade pwv
cd $ADE_VIEW_ROOT/bin
ant -f build.xml build

Now the actual script that contains the ade useview command should be as follows..

mainscript.sh
-------------
ade useview -exec /full/path/of/the/file/subshellcommands.sh view_name