-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate 3.0 rc1: loading the mapping takes very long
PostPosted: Thu Mar 10, 2005 6:11 pm 
Newbie

Joined: Thu Mar 10, 2005 6:05 pm
Posts: 3
Hello

I am a new hibernate user and I noticed that the loading of the
mapping takes currently ages. I have only 30 mapped classes and every
time running my test application takes approx. 2-3 mins just to load
the mapping. This is currently not really acceptable if you like to do
some rapid devlopment. Are there any similiar experiences and some
workarounds?

I saw that the same question had been asked once for hinernate 2.0 (see at the end of the message). There was the solution to use another
cglib.jar , I tried with the newest one v2.1 which is available at
cglib.sf.net but this did not change the behaviour.

Has someone other experience and find a solution for my issue?

Thank you
regards

Mark Egloff


My current java code for loading the configuration
--------------------------------------------------
public static void main(String[] args) throws Exception
{
Configuration config = new Configuration().configure(new
File("hibernate.cfg.xml"));

sf = config.buildSessionFactory();
session = sf.openSession();

System.out.println("start...");
...
}


copy from the other FAQ Hibernate 2.0
--------------------------------------
Hibernate startup is slow, what can I do?

I just discovered the new cglib version available at cglib.sf.net.
Using the new library has cut my Hibernate startup configuration times
from sometimes 3 minutes (I had over 70 persistent classes) to nearly
nothing. This has been a godsend, given the nature of the app is that
it has to be restarted for every code change -- debugging could be a
nightmare.

If not allready done could you (Gavin) start packaging this newer
version with Hibernate -- it's a real time saver.

Luke Monahan

You need to remove bcel.jar from classpath and use asm.jar for
performance ( BCEL has priority in cglib 1.0 ). We will drop BCEL in
the next version.

Juozas Baliuka


Top
 Profile  
 
 Post subject: Re: Hibernate 3.0 rc1: loading the mapping takes very long
PostPosted: Thu Mar 10, 2005 6:17 pm 
Newbie

Joined: Thu Mar 10, 2005 6:05 pm
Posts: 3
Hello

I am a new hibernate user and I noticed that the loading of the
mapping takes currently ages. I have only 30 mapped classes and every
time running my test application takes approx. 2-3 mins just to load
the mapping. This is currently not really acceptable if you like to do
some rapid devlopment. Are there any similiar experiences and some
workarounds?

I saw that the same question had been asked once for hinernate 2.0 (see at the end of the message). There was the solution to use another
cglib.jar , I tried with the newest one v2.1 which is available at
cglib.sf.net but this did not change the behaviour.

Has someone other experience and find a solution for my issue?

Thank you
regards

Mark Egloff


copy from the other FAQ Hibernate 2.0
--------------------------------------
Hibernate startup is slow, what can I do?

I just discovered the new cglib version available at cglib.sf.net.
Using the new library has cut my Hibernate startup configuration times
from sometimes 3 minutes (I had over 70 persistent classes) to nearly
nothing. This has been a godsend, given the nature of the app is that
it has to be restarted for every code change -- debugging could be a
nightmare.

If not allready done could you (Gavin) start packaging this newer
version with Hibernate -- it's a real time saver.

Luke Monahan

You need to remove bcel.jar from classpath and use asm.jar for
performance ( BCEL has priority in cglib 1.0 ). We will drop BCEL in
the next version.

Juozas Baliuka

My current java code for loading the configuration
--------------------------------------------------
public static void main(String[] args) throws Exception
{
Configuration config = new Configuration().configure(new
File("hibernate.cfg.xml"));

sf = config.buildSessionFactory();
session = sf.openSession();

System.out.println("start...");
...
}


My current CLASSPATH
----------------------------
lib/jdbc2_0-stdext.jar
lib/cglib-full-2.0.2.jar
lib/xercesImpl.jar
lib/mysql-connector-java-3.1.5-gamma-bin.jar
lib/log4j.jar
lib/commons-logging.jar
lib/dom4j-1.5.2.jar
lib/commons-collections-2.1.1.jar
lib/ehcache-1.1.jar
lib/jta.jar
lib/xmlParserAPIs.jar
lib/hibernate3.jar

My mapping document
--------------------------
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- properties -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/vinylian</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.pool_size">5</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="use_sql_comments">true</property>
<!-- mapping files -->
<mapping resource="com/bi/shop/vinylian/entity/AddressCategoryVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/AddressVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/AlbumTypeVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/AttributesVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/ItemVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/CdVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/ContactCategoryVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/ContactVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/CountryVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/CurrencyVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/EmailCategoryVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/EmailVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/ItemStatusVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/LanguageVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/MP3SongVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/OrderPositionVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/OrderStatusVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/OrderVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/PhoneNumberCategoryVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/PhoneNumberVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/PictureCategoryVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/PictureVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/PresentationVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/PriceCategoryVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/PriceVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/SalutationVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/SoundTrackVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/StockVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/UserVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/VinylSizeVO.hbm.xml"/>
<mapping resource="com/bi/shop/vinylian/entity/VinylVO.hbm.xml"/>

</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2005 7:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
check if your mapping files are referring the 3.0 dtd


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2005 12:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
2-3 minutes for 30 classes is completely unreasonable, there must be something else wrong.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2005 4:03 pm 
Newbie

Joined: Thu Mar 10, 2005 6:05 pm
Posts: 3
Thanks for the hint!!

I generated the mapping files with xdoclet and this is currently limited to set the hibernate version to 2.0. So the generated mapping files did refer o the 2.0 dtd

I changed it afterwards to

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">


and it works now fine! The loading takes only around a second.
great!

regards
Mark


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