ETS.zip sample application is based on standard HR schema, Employees table. When developing this sample, at first I have generated TopLink entity object from Employees table. The second step was to create OC4JServerPlatformConfig class, this class will configure the session's server platform. The third step was to configure sessions.xml:
- Open sessions.xml in JDeveloper dialog window
- In General tab select check box for External Transaction Controller and enter following class name - oracle.toplink.transaction.oc4j.Oc4jTransactionController. For Session Event Listeners add - lt.andrejusb.persistence.OC4JServerPlatformConfig class name
- In Login tab select General tab and choose Data Source option for Data Source Location. Enter data source name in Data Source field, for example - jdbc/HrDS. Clear all other checkboxes in this tab
- In Login tab select Options tab and set True for External Connection Pool and External Transaction Controller
There is no explicit commit operation in updateSalary(Employees). UnitOfWork is acquired from session.getActiveUnitOfWork(), however if there is no active UnitOfWork session.acquireUnitOfWork() is used. Salary and commission points are updated using Employees clone object.
In the View layer, two JSF pages are used - view.jspx and edit.jspx. In view.jspx user can browse through available emploees data, and in edit.jspx update salary of the selected employee. Update button of ADF Faces Form in edit.jspx is binded to updateSalary(Employees) method.
Merry Christmas everyone! :)