@Override
public List<Sample> getSampleRecords() {
List<Sample> samples = null;
try {
Query query = entityManager
.createQuery(
"from Sample s order by s.createdAt desc")
.setLockMode(LockModeType.PESSIMISTIC_WRITE);
query.setMaxResults(100);
samples = query.getResultList();
} catch (Exception exceptionGetSample) {
logger.error("Exception while retrieving the records", exceptionGetSample);
}
return samples;
}
When I executed it with oracle db an error occur :
Caused by: org.eclipse.persistence.exceptions.DatabaseException:
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00907: missing right parenthesis
I have used the eclipselink 2.5.0 library.
Please suggest some way so that I can use both the locking as well as can limit the records by using setMaxResults.
请参阅下面的链接以快速解决问题https://bugs.eclipse.org/bugs/show_bug.cgi?id=453208#c7
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.