InitialContext ctx = new InitialContext();
Context enc = (Context) ctx.lookup("java:comp/env");
LocalCheckBookHome home = (LocalCheckBookHome) enc.lookup("ejb/LocalCheckBookHome");
try
{
checkBook = home.findByPrimaryKey(account);
}
catch(FinderException e)
{
log.info("Failed to find CheckBook for: "+account);
checkBook = home.create(account, balance);