PessimisticLockException generated By EclipseLink Embedded in WebLogic 12.1.3 (Doc ID 2185517.1)

Last updated on SEPTEMBER 27, 2016

Applies to:

Oracle TopLink - Version 12.1.3.0.0 and later
Information in this document applies to any platform.

Symptoms

Using EclipseLink on Weblogic 12.1.3 version with Oracle Database and MySQL DB, it generates the Wrong SQL and throws the following exception


javax.persistence.PessimisticLockException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd):org.eclipse.persistence.exceptions.DatabaseException

Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00907: missing right parenthesis Error Code: 907 Call: SELECT * FROM (SELECT a.*, ROWNUM rnum FROM (SELECT N_ID AS a1, C_DESCRIPTION AS a2, version AS a3, C_SUMMARY AS a4 FROM MY_ENTITY_TABLE WHERE (C_SUMMARY = ?) FOR UPDATE) a WHERE ROWNUM <= ?) WHERE rnum > ? bind => [3 parameters bound]

Query:ReadAllQuery(name="query.MyEntity.findMyEntityBySummary" referenceClass=MyEntity sql="SELECT * FROM (SELECT a.*, ROWNUM rnum FROM (SELECT N_ID AS a1, C_DESCRIPTION AS a2, version AS a3, C_SUMMARY AS a4 FROM MY_ENTITY_TABLE WHERE (C_SUMMARY = ?) FOR UPDATE) a WHERE ROWNUM <= ?) WHERE rnum > ?")

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms