try {
tx = session.beginTransaction();
Area oldArea = (Area) session.get(Area.class, areaName);
Area newArea = (Area) session.get(Area.class, newAreaName);
User user = (User) session.get(User.class, username);
List<String> pushMsgsOldArea = new ArrayList<String>();
List<String> pushMsgsNewArea = new ArrayList<String>();
//Check that the user has rights for the new area as well
if ((newArea != null && (newArea.isAdmin(username) || newArea.isEditor(username)))
|| (user != null && user.isMasterAdmin())) {
List<Story> storiesToMove = new ArrayList<Story>();
//Get all the stories to move
for (int id : storyIds) {
Query storyQuery = session.createQuery("from Story where area like ? and id=?");