try {
LocalCustomer cust =
customerHome.findByPrimaryKey(customerId);
LocalItem items[] = new LocalItem[itemNumbers.length];
for (int i = 0; i < itemNumbers.length; i++) {
items[i] = itemHome.findByPrimaryKey(itemNumbers[i]);
}
LocalSalesRecord record =
recordHome.createRecord(items, cust);
return (new ReceiptDTO(record));
} catch(Exception ex) {
throw new
EJBException("Error processing sale: " + ex, ex);
}