Skip to main content

Displaying Transaction Log When User Commits a Transaction

I'm attaching a simple example that illustrates a possible solution to display number of rows(new, modified,  deleted) posted to database when user commits transaction.

This example overrides EntityImpl::doDML(int operation, TransactionEvent e) method to track the status of entities and save the log in UserData hash table object from the DBTransaction. The custom AppModuleImpl::commitTransactionWithStatusLog() does the commit and returns the transaction log as Map to the client which is displayed on the UI in the 'statusbar' facet for the table(wrapped by af:panelCollection). If you are interested, take a look at the custom variable binding in the page definition file in the attached sample. This basically does the wiring job  for the returned Map by commitTransactionWithStatusLog() method. May be useful for you later :)


You can download the sample workspace from here. [Runs with Oracle JDeveloper (11g R2PS1) + HR Schema]

How to run this sample?

1. Run test.jsf
2. Modify rows on the table and click on 'Commit Transaction With Status Log'. Application displays transaction status (rows modified, deleted, inserted) in the status bar.


mukesh said…
Hi Jobinesh,

Can you please tell me how the custom variable is added to the executable section?
Jobinesh said…
It was added manually :)
mukesh said…
Thanks Jobinesh..
I see that the EL uses '$'. I found that '$' is used in the case of immediate evaluation and '#' is used in the case of deferred evaluation. Also i saw the below links

I just need to know immediate in the sense which phase it gets evaluated and how does it differ from deferred evaluation.

Popular posts from this blog

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…