try
{
InitialContext ctx = new InitialContext();
Context enc = (Context) ctx.lookup("java:comp/env");
EntityPKHome home = (EntityPKHome) enc.lookup("ejb/EntityPKHome");
EntityPK bean = home.findByPrimaryKey(theKey);
bean.setOtherField(accessCount);
log.debug("Set EntityPK.OtherField to: "+accessCount);
beanCount = bean.getOtherField();
}
catch(Exception e)