-->
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.  [ 6 posts ] 
Author Message
 Post subject: Improve performance
PostPosted: Fri Jan 30, 2004 12:04 pm 
Newbie

Joined: Mon Jan 12, 2004 11:59 am
Posts: 13
Location: USA
Hi:
When I use Hibernate it takes about 16 ms to perform the session.save() method but the session.flush() takes about 500 ms to save one record in the Oracle 9i database. This record makes 15 inserts in 11 different tables.

Is there any way to improve the performance of the inserts?

My method is as follows:
Code:
public void createOneClaim() throws HibernateException, NamingException, SQLException, ClassNotFoundException
{
   Session session = sessionFactory.openSession(conn);
                long methodStartTime = System.currentTimeMillis();
      
      ClaimImpl claim  = new X12ClaimMapperTestUtil().getClaim();
      
      long startTime = System.currentTimeMillis();

      System.out.println("Starting to save at: " + startTime);
      session.save(claim);

      System.out.println("Saved time: " + (System.currentTimeMillis() - startTime));

      System.out.println("Method TIme: " + (System.currentTimeMillis() - methodStartTime));
      
      long flushTime = System.currentTimeMillis();
      session.flush();
      System.out.println("Flush Time: " + (System.currentTimeMillis() - flushTime));
      session.close();
      conn.close();
}


Thank you,
Om


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 1:08 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
save() don't actually execute the insert statement (except when using identity), so your DB roundtrip is done in the flush clause.

However 500ms is pretty high, wo mapping it's hard to help you to improve it.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 1:49 pm 
Newbie

Joined: Mon Jan 12, 2004 11:59 am
Posts: 13
Location: USA
My mapping is very simple. I have totally 44 class elements in the map XML file. I have no subclass or joined-subclass elements. I use the uuid.hex generator class for every <class> tag in the XML file.

Some classes have lists of objects of other class. Some of these classes in turn have their own lists of object of other classes and so on and so forth. The maximum table depth I have is 5 including the Master table and its leaf table.

I also have components in some classes.

In fact, I wrote a quick and dirty JDBC test class to find out the speed using PreparedStatement and I found it to be about 114 ms per record.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 1:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
350 ms overhead is ridiculously high, so you are doing something wrong, obviously.

You are welcome to check the performance tests in the Hibernate test package if you wish to verify this.

If you need help with performance optimization, I recommend contacting us about commercial support.


++++++++++++++++++++++++

My suggestion to everyone is that we will no longer try to solve these kinds of performance issues in the user forum because

(1) it is almost impossible
(2) it wastes too much of our time

Instead, we will provide a simple test case that demonstrates high performance so that users are able to verify our claims, and have something to work from.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 3:04 pm 
Newbie

Joined: Mon Jan 12, 2004 11:59 am
Posts: 13
Location: USA
If I purchase JBoss commercial support will I be able to get Hibernate support free of cost?
If yes, what kind of support should I purchase from the JBoss Group?

Thank you,
Om


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 3:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
If I purchase JBoss commercial support will I be able to get Hibernate support free of cost?


Correct, there is one support contract which covers JBoss, Hibernate, Tomcat, JBossCache.

Quote:
If yes, what kind of support should I purchase from the JBoss Group?


Development support. Email us your phone number and I will get Ben Sabrin to call you if you are interested.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.