Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Optimization batch reading collection after invalidation
Optimization batch reading collection after invalidation [message #1809365] Sun, 14 July 2019 22:53 Go to next message
Eclipse UserFriend
Any optimization available in EclipseLink that would avoid doing a SQL for each item in the collection having expired children?

You can run the main entry from the class Application, the log will finish with the output below, showing one select for each item in the collection. I'm looking for an existing feature in EclipseLink that could make this not happening. I believe Hibernate can handle that with https://docs.jboss.org/hibernate/orm/3.5/reference/en/html/performance.html#performance-fetching-batch.
If no feature exist to handle that, could you open a feature request?




[EL Fine]: sql: 2019-07-10 18:01:37.248--ServerSession(1837601499)--Connection(17331878)--Thread(Thread[main,5,main])--SELECT ID, FIRSTNAME, LASTNAME FROM ADDRESS WHERE (ID = ?)
bind => [2]
[EL Fine]: sql: 2019-07-10 18:01:37.249--ServerSession(1837601499)--Connection(1311052922)--Thread(Thread[main,5,main])--SELECT ID, FIRSTNAME, LASTNAME FROM ADDRESS WHERE (ID = ?)
bind => [3]
[EL Fine]: sql: 2019-07-10 18:01:37.25--ServerSession(1837601499)--Connection(810576909)--Thread(Thread[main,5,main])--SELECT ID, FIRSTNAME, LASTNAME FROM ADDRESS WHERE (ID = ?)
bind => [4]
[EL Fine]: sql: 2019-07-10 18:01:37.25--ServerSession(1837601499)--Connection(1629759610)--Thread(Thread[main,5,main])--SELECT ID, FIRSTNAME, LASTNAME FROM ADDRESS WHERE (ID = ?)
bind => [5]
[EL Fine]: sql: 2019-07-10 18:01:37.251--ServerSession(1837601499)--Connection(775423528)--Thread(Thread[main,5,main])--SELECT ID, FIRSTNAME, LASTNAME FROM ADDRESS WHERE (ID = ?)
bind => [6]
  • Attachment: Sample.zip
    (Size: 10.67KB, Downloaded 163 times)
Re: Optimization batch reading collection after invalidation [message #1810471 is a reply to message #1809365] Mon, 12 August 2019 10:05 Go to previous message
Eclipse UserFriend
Batch fetching can be added to your queries using query hints:
https://www.eclipse.org/eclipselink/documentation/2.5/jpa/extensions/q_batch.htm

Or to the model relationship via annotation:
https://www.eclipse.org/eclipselink/documentation/2.5/jpa/extensions/a_batchfetch.htm

Previous Topic:Passing Collection List to In clause in nativeQuery - EclipseLink
Next Topic:EclipseLink with Java 9+
Goto Forum:
  


Current Time: Mon May 12 16:10:00 EDT 2025

Powered by FUDForum. Page generated in 0.02948 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top