-->
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.  [ 2 posts ] 
Author Message
 Post subject: Addind mapping to sessionFactory
PostPosted: Mon Jun 21, 2004 5:08 am 
Regular
Regular

Joined: Thu Sep 04, 2003 10:43 am
Posts: 61
This is the situation:
I have a J2EE application, when there is the first call to Hibernate I build a configuration object, from which I build a sessionFactory object which I store in JNDI ... this first step maps all the classes (and of course is quite slow)
On the second call I get my session factory from JNDI ... and everything is fast.
My problem is that I have to add a new class to map a run time, after the configuration object is build and throw away ...
I've seen that sessionFactory has the evict method to remove an old class, but how can I add a new one?
Should I keep in some cache the configuration object and make a new sessionFactory from this one (after adding the new mapping)? Is this a dangerous operation to make while the application server is working, and so there are many other users who calls hibernte fuctions?
Any help will be appreciated
Regards
Alessandro Rizzi


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 21, 2004 6:14 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Session factory is "immutable" considering the mapping configuration, you have to build a new one.
.evict() is here to clear the cache, not to change the mapping configuration.

_________________
Emmanuel


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