@Create @Transactional public void initialize() { LOGGER.debug("hibernateSession.isConnected(): " + hibernateSession.isConnected()); LOGGER.debug("hibernateSession.isOpen(): " + hibernateSession.isOpen()); LOGGER.debug("hibernateSession.getTransaction(): " + hibernateSession.getTransaction()); LOGGER.debug( "hibernateSession.getTransaction().isActive(): " + hibernateSession.getTransaction().isActive()); localeId = charmsUser.getLocaleId(); themeId = charmsUser.getThemeId(); timezoneId = charmsUser.getTimezoneId(); email = charmsUser.getEmail(); LOGGER.debug( "initialized userPropertiesActionBean: " + " " + localeId + " " + themeId + " " + timezoneId); }
private String merge() { charmsUser.setEmail(email); charmsUser.setThemeId(themeId); charmsUser.setTimezoneId(timezoneId); charmsUser.setLocaleId(localeId); // merge the user to the DB, the user is outjected to session charmsUser = (CharmsUser) hibernateSession.merge(charmsUser); hibernateSession.flush(); // set the session parameters from the user values localeSelector.selectLocaleId(charmsUser.getLocaleId()); themeSelector.selectThemeId(charmsUser.getThemeId()); timezoneSelector.selectTimeZoneId(charmsUser.getTimezoneId()); // ((Session)entityManager.getDelegate()).flush(); return "saved"; }