-->
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.  [ 4 posts ] 
Author Message
 Post subject: BuildSessionFactory is verrry slow
PostPosted: Fri Dec 12, 2003 4:45 pm 
Beginner
Beginner

Joined: Tue Sep 30, 2003 4:16 pm
Posts: 33
I know there's a warning to this effect in the doc, but:

Code:
   // add base classes
    cfg
      .addClass(Channel.class)
      .addClass(Item.class)
      .addClass(ItemGuid.class)
      .addClass(ItemEnclosure.class)
      .addClass(ItemSource.class)
      .addClass(Cloud.class)
      .addClass(Category.class)
      .addClass(ChannelGroup.class)
      .addClass(ChannelSubscription.class)
      .addClass(Image.class)
      .addClass(ItemMetadata.class)
      .addClass(TextInput.class);

    // get session factory
    sessions = cfg.buildSessionFactory();


Is verry slow (takes 5-10 seconds on a speedy machine.)

1) Are there any techniques for speeding this up, like precomputing whatever is being built by addClass() and/or buildSessionFacory()

2) I am writing a client app, where a 5-10 second delay at startup is a real problem. I am doing it in bacground already but still there is some state that's coming out of the database that is needed to propertly draw the screen.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 4:53 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
What version of Hibernate are you using? There has been a significant speed increase in this area in 2.1.


Sherman


Top
 Profile  
 
 Post subject: I'm using 2.03
PostPosted: Fri Dec 12, 2003 5:10 pm 
Beginner
Beginner

Joined: Tue Sep 30, 2003 4:16 pm
Posts: 33
Was that one significantly slower than 2.1?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 5:44 pm 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Ohhhh, yeah!

The cglib.jar in 2.0 has been upgraded to cglib2.jar.

I am seeing a more than 10x improvement in start up times.



Sherman


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