while(!foundfree){ try{ if(id > 1) publisherhome.findByPrimaryKey(new Integer(id)); id = ran.nextInt(); }catch(FinderException e){ foundfree = true;
while (!foundfree) { try { if (id > 1) publisherhome.findByPrimaryKey(new Integer(id)); id = ran.nextInt(); } catch (FinderException e) { foundfree = true; }
    private Integer findFreePublisherId(){      Random ran = (new Random((new Date()).getTime()));      int id = ran.nextInt();      boolean foundfree = false;      while(!foundfree){        try{          if(id > 1)            publisherhome.findByPrimaryKey(new Integer(id));            id = ran.nextInt();        }catch(FinderException e){           foundfree = true;        }      }      return new Integer(id);    } // findFreeHardTokenIssuerId