public class ReconciliationOLTPService { protected AccountObjectDAO accountDAO; protected AccountReconciliationSharedService reconcileService; public ReconciliationOLTPService() { // Initialize Data Access Object via Data Access Layer accountDAO = DAL.getDAL().getAccountDAO(); // Initialize Shared Service, which is used in OLTP & Batch reconcileService = new AccountReconciliationSharedService(); reconcileService.initialize(new Properties()); } public boolean reconcileAccount(String accountId) { try { // retrieve business record from Data Access Object AccountDomainObject obj = accountDAO.get(accountId); // shared service invocation. Service is unaware that // business record was retrieved via OLTP DAO or // Batch bulk data reader. obj = (AccountDomainObject) reconcileService.processRecord(obj); // ---------------------------------------- if (obj == null) return false; else { // persist processed record w/ Data Access Object accountDAO.put(obj); return true; } } catch (Throwable t) { throw new RuntimeException("Failed to reconcile account. " + t); } } }