ArrayList<Load> load_data = grabHourlyLoadForMonthAndYear(month, year);
if (load_data.size() > 0) {
System.out.println(load_data.size()+" objects");
em.getTransaction().begin();
for (Load l : load_data)
em.persist(l);
long start = System.currentTimeMillis();
em.getTransaction().commit();
System.out.println("time: "+ ((System.currentTimeMillis()-start)/1000) + " sec");
}
//---------------------------------------------
grabHourlyLoadForMonthAndYear() grabs the data from the web. "em" is the EntityManager.
The entity "Load" has 5 fields (id, country, year, hourInYear, load)
A typical output looks like this:
17856 objects
time: 102 sec
16128 objects
time: 551 sec
17856 objects
time: 1200 sec
As you can see, the time increases drastically while the number of objects doesn't. From a usability standpoint, that's way too much time spent on waiting.
Has anyone seen similar slow downs while using Derby together with TopLink Essentials in a desktop application?
Best Regards
Fabio