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
|
|