-->
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: Autodetection of dynamically created hbm.xml files
PostPosted: Wed Aug 17, 2005 1:32 am 
Beginner
Beginner

Joined: Mon Jul 25, 2005 12:35 am
Posts: 24
Location: Sri Lanka
Hi,

I'm developing a web application which has a module to dynamically create mapping hbm.xml files and save into class path.

Every time I create a hbm.xml mapping file I have to load that to sessionFactory. This will results reinitialization of connection pooler hence reduce the speed of the application.

Is there any way to auto ditect the dynamically created hbm.xml mapping files without explicitly loading to sessionFactory?

Really appreciate any help.
Thank you.
Thilina.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:27 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
I don't think so.
How else would you be able to get all those associations working correctly?
You need to build new session factory.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:58 am 
Beginner
Beginner

Joined: Mon Jul 25, 2005 12:35 am
Posts: 24
Location: Sri Lanka
Yes, I also realise that it will be a impossible task.

But....

According to following links, it seems (But havent tried) that Jboss+Hibernate will support hot deployement of hbm.xml mapping files.

http://forum.hibernate.org/viewtopic.php?t=925749.
http://www.hibernate.org/hib_docs/entit ... ation.html

But my web application is running on Tomcat. Is there any way to achive this?

Thank you.
Thilina.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 4:08 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
I think this hot deployment is used structly in JBoss, using their deployer architecture. But is is meant to deploy the whole persistence unit - a closed archive of entities (not being associated outside this archive).
So if your newly created entities are only dependant on them self, use JBoss and this new persistence-unit feature.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 4:30 am 
Beginner
Beginner

Joined: Mon Jul 25, 2005 12:35 am
Posts: 24
Location: Sri Lanka
Hi,
If I dynamically create hbm.xml files and put a new entry in hibernate.cfg.xml (as <mapping resource="beyondm/hibernate/main/XXX_SyatemUser.hbm.xml"/>) dyanmically at run time, then am I need to create a sessionFactory again?

Thilina.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 4:36 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
I have no such experience, but I think so.


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.