| Author |
Copying records from between 2 databases with JPA
|
Michael Darsow
Greenhorn
Joined: Mar 11, 2012
Posts: 3
|
|
Hi there!
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!
Thanks!
|
 |
James Sutherland
Ranch Hand
Joined: Oct 01, 2007
Posts: 550
|
|
See,
http://java-persistence-performance.blogspot.com/2011/06/how-to-improve-jpa-performance-by-1825.html
|
TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
|
 |
 |
|
|
subject: Copying records from between 2 databases with JPA
|
|
|