Namrata Jaiswal created OPENJPA-2656:
----------------------------------------
Summary: When an embedded table is used and there is huge
collection of data, open jpa APs fails to load data as it uses IN clause while
joining tables
Key: OPENJPA-2656
URL: https://issues.apache.org/jira/browse/OPENJPA-2656
Project: OpenJPA
Issue Type: Bug
Affects Versions: 2.2.0
Environment: all
Reporter: Namrata Jaiswal
Priority: Blocker
When an embedded table as shown below has been used inside an entity
@ElementCollection( fetch = FetchType.EAGER )
@CollectionTable( name = "PULL_STORAGE_BLOB_IDS", joinColumns = @JoinColumn(
name = "TRANSACTION_ID" ) )
@Column( name = "STORAGE_BLOB_ID" )
private Set<String> storageIds;
And suppose there are around 10K entries for such entity, then it fails with
the below exception. It looks like openjpa joins collection table using IN
clause which fails when there is huge entries.
[8/9/16 11:34:08:701 EDT] 00000123 openjpa.Runtime
I Starting OpenJPA 2.2.3-SNAPSHOT
[8/9/16 11:34:08:701 EDT] 00000123 openjpa.jdbc.JDBC
I Using dictionary class
"com.ibm.ws.persistence.jdbc.sql.SQLServerDictionary" (Microsoft SQL Server
11.00.6020 ,Microsoft JDBC Driver 4.0 for SQL Server 4.0.2206.100).
[8/9/16 11:34:08:888 EDT] 00000123 com.ibm.b2b.cache.preload.PreloadService
I BCXCH0107I: Loaded 1 records into map SecurityPolicy
[8/9/16 11:34:21:587 EDT] 00000123
com.ibm.ws.objectgrid.ClientDomainContextImpl I CWOBJ1127I: The
ObjectGrid client connection 11 disconnected from the Domain_1.0.0 domain.
ObjectGrids used by this connection were [IdentityGrid, MegBase, MegComms,
PreloadGrid].
[8/9/16 11:34:21:587 EDT] 00000123 SystemErr
R Exception in thread "Thread-86"
[8/9/16 11:34:21:587 EDT] 00000123 SystemErr
R <openjpa-2.2.3-SNAPSHOT-r422266:1677238 fatal general error>
org.apache.openjpa.persistence.PersistenceException: The incoming request has
too many parameters. The server supports a maximum of 2100 parameters. Reduce
the number of parameters and resend the request. {prepstmnt -1461118340
SELECT t0.TRANSACTION_ID, t1.STORAGE_BLOB_ID
FROM PULL_DESTINATION_RUNTIME_DATA t0 INNER JOIN PULL_STORAGE_BLOB_IDS
t1 ON t0.TRANSACTION_ID = t1.TRANSACTION_ID
WHERE t0.TRANSACTION_ID IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ....................................
[8/9/16 11:34:21:634 EDT] 00000123 SystemErr
R at
org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4991)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4951)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:118)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:70)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException(SelectResultObjectProvider.java:155)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
org.apache.openjpa.lib.rop.WindowResultList.getInternal(WindowResultList.java:150)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
org.apache.openjpa.lib.rop.AbstractNonSequentialResultList.get(AbstractNonSequentialResultList.java:73)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
org.apache.openjpa.kernel.DelegatingResultList.get(DelegatingResultList.java:259)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
com.ibm.b2b.cache.preload.MapPreloader.load(MapPreloader.java:277)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at
com.ibm.b2b.cache.preload.PreloadService$PreloadThread.run(PreloadService.java:180)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R at java.lang.Thread.run(Thread.java:798)
[8/9/16 11:34:21:680 EDT] 00000123 SystemErr
R Caused by:
[8/9/16 11:34:21:696 EDT] 00000123 SystemErr
R org.apache.openjpa.lib.jdbc.ReportingSQLException: The
incoming request has too many parameters. The server supports a maximum of 2100
parameters. Reduce the number of parameters and resend the request. {prepstmnt
-1461118340
SELECT t0.TRANSACTION_ID, t1.STORAGE_BLOB_ID
FROM PULL_DESTINATION_RUNTIME_DATA t0 INNER JOIN PULL_STORAGE_BLOB_IDS
t1 ON t0.TRANSACTION_ID = t1.TRANSACTION_ID
WHERE t0.TRANSACTION_ID IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)