-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: flush performance?
PostPosted: Sat Oct 18, 2003 9:50 am 
Beginner
Beginner

Joined: Thu Oct 02, 2003 5:06 am
Posts: 26
Location: Budapest, Hungary
Importing data, we have the following speeds (in ms)
Code:
FI import:  7492 records inserted... Time:13877
FI import:  7492 records flushed... Time:662184


I had assumed that actually creating the objects would be the slow part, but it appears that the flush to database is the bigger bottleneck. Somehow I find it hard to believe that the database is the problem unless its a combination of jdbc and statement creation? Are the insert/update statements generated in batches, or send 1-at-a-time to the database?

Are there any optimization tricks I should be aware of (on the hibernate side)?

Using: postrgreSQL, linux, and jboss 3.2.1 w/tomcat

Thnx.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 18, 2003 1:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
"I find it hard to believe that the database is the" bottleneck

LOL, you have not been working with databases very long, huh?

During flush() is when all the work Hibernate does synchronizing in-memory state with the database. So this typically is the slowest phase


Top
 Profile  
 
 Post subject: actually....
PostPosted: Sat Oct 18, 2003 1:52 pm 
Beginner
Beginner

Joined: Thu Oct 02, 2003 5:06 am
Posts: 26
Location: Budapest, Hungary
actually I've been working with databases for a long time, but when postgres does 10000+ inserts in a minute from a psql command (batch file), it seems a bit funny that it would be that much slower.. thats why I expect it to be the jdbc that slows things down, rather than the netowrk speed since similar timings are seen when running both DB and jboss/hibernate on the same machine.

Cheers..


Top
 Profile  
 
 Post subject: but while you're here.. ;-)
PostPosted: Sat Oct 18, 2003 1:55 pm 
Beginner
Beginner

Joined: Thu Oct 02, 2003 5:06 am
Posts: 26
Location: Budapest, Hungary
While I have your attention, any idea how to catch a jboss transaction timeout from hibernate? session.flush() just goes on until all have been flushed, even if a timeout occurred in the first minute or so.. and doesn't seem to notice any errors when it returns from the call. What am i missing? how can it keep sending the statements if the connection is not available?

thnx...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 18, 2003 2:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
No idea. I don't use JBoss.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 19, 2003 7:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Note that the postgres JDBC driver is incredibly slow, so we expect inserts done from Java to be much slower than inserts done from a batch file.


Top
 Profile  
 
 Post subject: aha...
PostPosted: Sun Oct 19, 2003 4:59 pm 
Beginner
Beginner

Joined: Thu Oct 02, 2003 5:06 am
Posts: 26
Location: Budapest, Hungary
Aha! That would do it. I was unawares that postgres's jdbc was known for being slow as molasses.... thnx.
Ati.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.