This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am new to this forum. Found this forum while looking for a solution for my problem. It looks very cool!
I need your help. I am doing JPA (eclipselink) since some weeks and i am wondering if there is a way to optimize my code.
Simplified i need to copy 500-1000 records from one database to another when the user presses on a button.
I have the entities A and B where A has a list of B.
So when the user starts the copying i load all B's from A with
and then i iterate over the list and persist each B.
This takes about 2-3 seconds for 500-1000 records. (just guessed the time, did not measure it)
My question is how this can be optimized?
The first thing i have in mind is the caching.
The caching is active, but i do not need all these records to get into the cache.
Is it possible to bypass the cache for loading and persisting these records?
And if there are more ways to optimize the process i would be very happy if you can help me out!