public Long getMaxRowID(String userName) {
		Object chatRoomMessagesMaxRowID;
		EntityManager em = PersistenceManager.createEntityManager();
		try {
			chatRoomMessagesMaxRowID = em
					.createNamedQuery("Openchatroomsmessage.GetMaxRowId")
					.setParameter("u", userName)
					.getSingleResult();
		} finally {
			em.close();
		}
		return chatRoomMessagesMaxRowID == null ?  0 : (Long)chatRoomMessagesMaxRowID;
	}