boolean ret = false; try { AdminPreferencesDataLocal apdata = adminpreferenceshome.findByPrimaryKey(serialnumber.toString()); adminpreferenceshome.remove(serialnumber.toString()); try{ AdminPreferencesDataLocal apdata2 = adminpreferenceshome.findByPrimaryKey(serialnumber.toString()); }  catch (javax.ejb.FinderException fe) { } apdata= adminpreferenceshome.create(serialnumber.toString(),adminpreference); try{ AdminPreferencesDataLocal apdata3 = adminpreferenceshome.findByPrimaryKey(serialnumber.toString()); }  catch (javax.ejb.FinderException fe) { } logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(),null, null, LogEntry.EVENT_INFO_ADMINISTRATORPREFERENCECHANGED,"Administrator preference changed."); ret = true; } catch (javax.ejb.FinderException fe) { ret=false; try{ logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_ADMINISTRATORPREFERENCECHANGED,"Administrator cannot be found i database."); }catch (RemoteException re) {} } catch(Exception e){ throw new EJBException(e); } debug("<changeAdminPreference()"); return ret;
return updateAdminPreference(admin, serialnumber, adminpreference, true);
    public boolean changeAdminPreference(Admin admin, BigInteger serialnumber, AdminPreference adminpreference){       debug(">changeAdminPreference(serial : " + serialnumber + ")");       boolean ret = false;        try {            AdminPreferencesDataLocal apdata = adminpreferenceshome.findByPrimaryKey(serialnumber.toString());            adminpreferenceshome.remove(serialnumber.toString());            try{                AdminPreferencesDataLocal apdata2 = adminpreferenceshome.findByPrimaryKey(serialnumber.toString());            }  catch (javax.ejb.FinderException fe) {            }            apdata= adminpreferenceshome.create(serialnumber.toString(),adminpreference);            try{                AdminPreferencesDataLocal apdata3 = adminpreferenceshome.findByPrimaryKey(serialnumber.toString());            }  catch (javax.ejb.FinderException fe) {            }            logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(),null, null, LogEntry.EVENT_INFO_ADMINISTRATORPREFERENCECHANGED,"Administrator preference changed.");              ret = true;        } catch (javax.ejb.FinderException fe) {             ret=false;             try{               logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_ADMINISTRATORPREFERENCECHANGED,"Administrator cannot be found i database.");                           }catch (RemoteException re) {}        } catch(Exception e){            throw new EJBException(e);        }        debug("<changeAdminPreference()");        return ret;    } // changeAdminPreference