List of usage examples for com.liferay.portal.kernel.transaction Isolation READ_COMMITTED
Isolation READ_COMMITTED
To view the source code for com.liferay.portal.kernel.transaction Isolation READ_COMMITTED.
Click Source Link
From source file:com.liferay.linkshortener.service.impl.LinkLocalServiceImpl.java
License:Open Source License
/** * Deletes all the Links that were not modified after the specified date. * * @param olderThen boundary date for the deletion. *//*from www. jav a 2 s. co m*/ @Override @Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW) public void deleteOldRecords(Date olderThen) { try { Session session = linkPersistence.openSession(); String sql = CustomSQLUtil.get(_DELETE_LINKS); SQLQuery sqlQuery = session.createSQLQuery(sql); QueryPos qPos = QueryPos.getInstance(sqlQuery); Timestamp olderThenTS = CalendarUtil.getTimestamp(olderThen); qPos.add(olderThenTS); sqlQuery.executeUpdate(); linkPersistence.closeSession(session); } catch (ORMException orme) { _LOG.error("Unable to remove old Links.", orme); } }