int NUM_VERSIONS = 3000; long ID = 10426; com.liferay.portal.model.User user = com.liferay.portal.service.UserServiceUtil.getUserById( com.liferay.portal.security.permission.PermissionThreadLocal.getPermissionChecker().getUserId()); com.liferay.portal.service.ServiceContext sc = new com.liferay.portal.service.ServiceContext(); sc.setUserId(user.getUserId()); sc.setScopeGroupId(user.getGroupId()); com.liferay.portal.service.ServiceContextThreadLocal.pushServiceContext(sc); com.liferay.portlet.journal.model.JournalArticle journalArticle = com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.getArticle(ID); long start = System.currentTimeMillis(); long end = start; for (int i = 0; i < NUM_VERSIONS; i++) { long it_start = System.currentTimeMillis(); journalArticle = com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil.updateArticle( sc.getUserId(), journalArticle.getGroupId(), journalArticle.getArticleId(), journalArticle.getVersion(), journalArticle.getContent(), sc ); end = System.currentTimeMillis(); System.out.println('It: '+i+' - Created article version: ' + journalArticle.getVersion() + ' Id: '+journalArticle.getId()+ ' time: '+(end-it_start)/1000); } System.out.println(NUM_VERSIONS+' versions created - spend time: '+(end-start)/1000);