Is that hibernate? I haven't used it for so long I forget the method names... You probably need to run it through a profiler ( http://h2database.com/html/performance.html#built_in_profiler ) and see what it is doing. It could be doing optimistic locking checks or multiple queries or anything. At the minimum you need to find out what SQL it is executing so you can run explain on it ( http://h2database.com/html/grammar.html#explain ) to see if it is using the index or doing a table scan or anything.

Hope that helps a little bit :)

Ryan

On 29/10/2013 1:00 PM, TrendTimer.com wrote:
adding CACHE_SIZE=32768 to the jdbc url helped speed up the updates to 6 ms. So this is better, but still a lot slower that the inserts. I'm timing the inserts like this:


long startTime=System.currentTimeMillis();
try {
getDao().createOrUpdate(combinedTestDay);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
long endTime=System.currentTimeMillis();
long totalTime=endTime-startTime;
System.out.println("createOrUpdateTime="+totalTime);


and the output is always:

createOrUpdateTime=0


On Monday, October 28, 2013 9:32:23 PM UTC-7, TrendTimer.com wrote:

    When I use "createOfUpdate", I can insert 10000 rows in the table
    almost immediately.

    getDao().createOrUpdate(combinedTestDay);


    but then when I try to update these same items, it's taking around
    70 ms each:

    getDao().update(saveObject);

    So for 10,000 updates  that's 70,000ms or around 70 seconds.

    Can someone explain what might be happening?  Does anyone know how
    to work around this issue?  I'd appreciate your help! thanks,

    Stephen Gower




--
You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to