Pages

Thursday, July 26, 2018

Displaying Transaction Log When User Commits a Transaction

Displaying Transaction Log When User Commits a Transaction


Im 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 :)


Download

You can download the sample workspace from here. [Runs with Oracle JDeveloper 11.1.2.1.0 (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.


visit link download

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.