Chapter 15 - Code Snippets ========================== p. 514, step 4 at the bottom of the page: Transaction acctPromTrans = acctPromModule.getTransaction(); ---------------------------------------------------------------------------------- p.515, step 5: (This is a corrected version of the printed text.) acctPromTrans.setLockingMode(Transaction.LOCK_OPTIMISTIC); step 1: try { System.out.println("Attempting to commit changes."); acctPromTrans.commit(); System.out.println("Commit successful."); } step 2: catch (RowInconsistentException e) { System.out.println("Data conflict detected. Rolling back."); acctPromTrans.rollback(); } ---------------------------------------------------------------------------------- p.516, step 2: import oracle.jbo.server.TransactionEvent; step 3: public void beforeCommit(TransactionEvent e) { System.out.println( "About to commit changes to employee " + getEmployeeId() ); super.beforeCommit(e); } ---------------------------------------------------------------------------------- p.517, step 1: public void beforeRollback(TransactionEvent e) { System.out.println( "Discarding changes to employee " + getEmployeeId() ); super.beforeRollback(e); } p.518, step 2: SELECT * FROM EMPLOYEES WHERE JOB_ID IN('FI_ACCOUNT', 'FI_MGR') under "What Just Happened?:" ALTER TRIGGER UPDATE_JOB_HISTORY DISABLE; UPDATE EMPLOYEES SET JOB_ID = 'FI_ACCOUNT' WHERE EMPLOYEE_ID BETWEEN 109 AND 113; ALTER TRIGGER UPDATE_JOB_HISTORY ENABLE; ---------------------------------------------------------------------------------- p.519, step 3: Transaction acctPromTrans = getTransaction(); try { System.out.println("Attempting to commit changes."); acctPromTrans.commit(); System.out.println("Commit successful."); } catch (RowInconsistentException e) { System.out.println("Data conflict detected. Rolling back."); acctPromTrans.rollback(); } ---------------------------------------------------------------------------------- p.521, toward top of page: ApplicationPool acctPromPool = poolMgr.findPool( "hrbc4j.AccountantPromotionModule", "hrbc4j", "AccountantPromotionModuleLocal", null); bottom of page: String timeStamp = (new java.util.Date()).toString(); SessionCookie acctPromCookie = acctPromPool.createSessionCookie( "acctPromModule1", timeStamp, null ); ----------------------------------------------------------------------------------