-->
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.  [ 1 post ] 
Author Message
 Post subject: build new SessionFactory at runtime for datasource
PostPosted: Tue May 04, 2004 5:12 pm 
Newbie

Joined: Tue May 04, 2004 3:32 pm
Posts: 16
Location: Iowa
I saw it was said that we can build new sessionfactory instance at runtime for different datasource. This is very interesting to me. I could use code like:
SessionFactory newSessionFactory = config.buildSessionFactory();
where config is a Configuration object.

My trouble is that I need to clone the Configuration object of the existing session factory. The only thing I need to change on this cloned Configuration object is the "datasource name" property.

Can I iterate through the configuration object and get all property values and creat a new configuration object based on these properties?If so, which method I should call? sessionFactory.getAllClassMetadata()?

I am using Jboss so that there is no configuration files to read. I try to find if I can use the mbean of the existing SessionFactory, but I don't see any operation I can use.

We really need a sessionFactory.getConfiguration() method.

Please advise.

--Richard


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.