Throws: {@link java.lang.IllegalStateException} - if the transaction has alreadybeen committed, rolled back
606607608609610611612613614615616
statisticMgmtService.decPublishedBlogCommentCount(); transaction.commit(); } catch (final Exception e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.ERROR, "Removes a comment of a page failed", e); throw new ServiceException(e); }
193194195196197198199200201202203
transaction.commit(); return ret; } catch (final Exception e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.SEVERE, "Adds a link failed", e); throw new ServiceException(e); }
639640641642643644645646647648649
statisticMgmtService.decPublishedBlogCommentCount(); transaction.commit(); } catch (final Exception e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.ERROR, "Removes a comment of an article failed", e); throw new ServiceException(e); }
96979899100101102103104105106
userRepository.update(oldUserId, oldUser); transaction.commit(); } catch (final RepositoryException e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.SEVERE, "Updates a user failed", e); throw new ServiceException(e); }
130131132133134135136137138139140
final String userEmail = requestJSONObject.optString(User.USER_EMAIL). trim().toLowerCase(); final JSONObject duplicatedUser = userRepository.getByEmail(userEmail); if (null != duplicatedUser) { if (transaction.isActive()) { transaction.rollback(); } throw new ServiceException(langPropsService.get("duplicatedEmailLabel")); }
153154155156157158159160161162163
transaction.commit(); return user.optString(Keys.OBJECT_ID); } catch (final RepositoryException e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.SEVERE, "Adds a user failed", e); throw new ServiceException(e); }
176177178179180181182183184185186
userRepository.remove(userId); transaction.commit(); } catch (final RepositoryException e) { if (transaction.isActive()) { transaction.rollback(); } LOGGER.log(Level.SEVERE, "Removes a user[id=" + userId + "] failed", e); throw new ServiceException(e); }
142143144145146147148149150151152
permalink = "/" + permalink; } if (PermalinkQueryService.invalidPagePermalinkFormat(permalink)) { if (transaction.isActive()) { transaction.rollback(); } throw new ServiceException(langPropsService.get("invalidPermalinkFormatLabel")); }
150151152153154155156157158159160
throw new ServiceException(langPropsService.get("invalidPermalinkFormatLabel")); } if (!oldPermalink.equals(permalink) && permalinkQueryService.exist(permalink)) { if (transaction.isActive()) { transaction.rollback(); } throw new ServiceException(langPropsService.get("duplicatedPermalinkLabel")); } }
178179180181182183184185186187188
LOGGER.log(Level.DEBUG, "Updated a page[id={0}]", pageId); } catch (final Exception e) { LOGGER.log(Level.ERROR, e.getMessage(), e); if (transaction.isActive()) { transaction.rollback(); } throw new ServiceException(e); } }