-->
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.  [ 3 posts ] 
Author Message
 Post subject: Ways to improve application start-up performance?
PostPosted: Wed Jul 16, 2008 7:06 am 
Newbie

Joined: Wed Jul 16, 2008 6:55 am
Posts: 1
Hi
I'm using Java Persistence with Hibernate and annotations in a standard J2SE application.

The issue I have is that it is taking 3-4 seconds to initialise everything in hibernate when I start the application. Nothing is hitting the DB at this point.

I've got about 60 entities in my application (and this is likely to grow).

So at startup, I get lots of entries like this as it processes the entities and annotations:

Code:
FINE [org.hibernate.cfg.annotations.SimpleValueBinder]: building SimpleValue for attachmentPath
FINE [org.hibernate.cfg.annotations.PropertyBinder]: Building property attachmentPath
FINE [org.hibernate.cfg.AnnotationBinder]: Processing annotations of com.categoric.businesslayer.entities.FTPAttachment.module
FINE [org.hibernate.cfg.Ejb3Column]: Binding column ModuleID unique false
FINE [org.hibernate.cfg.Ejb3Column]: Binding column module unique false


And then I get a load more entries like this (not sure what it is doing at this point - building prepared statements?):

Code:
FINE [org.hibernate.persister.entity.AbstractEntityPersister]: Static SQL for entity: com.categoric.businesslayer.entities.TextFormat
FINE [org.hibernate.persister.entity.AbstractEntityPersister]:  Version select: select ModuleID from Module where ModuleID =?
FINE [org.hibernate.persister.entity.AbstractEntityPersister]:  Snapshot select: select textformat_.ModuleID, textformat_.name as name2_, textformat_.AdminXMLID as AdminXMLID2_, textformat_.AlertProfileID as AlertPro8_2_, textformat_.description as descript4_2_, textformat_.GraphLayoutID as GraphLay7_2_, textformat_.ModuleID2 as ModuleID5_2_, textformat_.ServerXMLID as ServerXM6_2_, textformat_.ServiceID as ServiceID2_, textformat_1_.MessageSection as MessageS1_60_, textformat_1_.TextFormatID as TextForm2_60_ from Module textformat_ left outer join TextFormat textformat_1_ on textformat_.ModuleID=textformat_1_.ModuleID where textformat_.ModuleID=?
FINE [org.hibernate.persister.entity.AbstractEntityPersister]:  Insert 0: insert into Module (name, AdminXMLID, AlertProfileID, description, GraphLayoutID, ModuleID2, ServerXMLID, ServiceID, ModuleTypeID, ModuleID) values (?, ?, ?, ?, ?, ?, ?, ?, 6, ?)
FINE [org.hibernate.persister.entity.AbstractEntityPersister]:  Update 0: update Module set name=?, AdminXMLID=?, AlertProfileID=?, description=?, GraphLayoutID=?, ModuleID2=?, ServerXMLID=?, ServiceID=? where ModuleID=?
FINE [org.hibernate.persister.entity.AbstractEntityPersister]:  Delete 0: delete from Module where ModuleID=?
FINE [org.hibernate.persister.entity.AbstractEntityPersister]:  Insert 1: insert into TextFormat (MessageSection, TextFormatID, ModuleID) values (?, ?, ?)
FINE [org.hibernate.persister.entity.AbstractEntityPersister]:  Update 1: update TextFormat set MessageSection=?, TextFormatID=? where ModuleID=?
FINE [org.hibernate.persister.entity.AbstractEntityPersister]:  Delete 1: delete from TextFormat where ModuleID=?


Is it possible to get hibernate to cache any of this information from previous runs of the application? Would going back to using XML mappings files be faster than using annotations? Any ideas on what I can do to remove this startup time. This is a big issue to me as this is a desktop RCP application so the user experience isn't good.

TIA
Ian


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 16, 2008 3:43 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

try to set the log level to info or warn. All the debug logging takes probalby a lot of time as well. There is no way at the moment to cache configuration from previous runs, although we were talking about parallizing some of the startup work.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 24, 2008 1:07 pm 
Beginner
Beginner

Joined: Wed Nov 05, 2003 7:51 am
Posts: 22
I have the same problem with my desktop application.

I only have ~50 classes and Hibernate startup is already >4s.

It would be really important to reduce this startup time because it makes Hibernate based rich clients VERY unfriendly.


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