From: yangju <nu...@jb...> - 2005-08-25 16:28:01
|
Talking about multiple sessionfactories, I am facing this issue now and hope you guys can give me some directions. I am using jboss 4.0.2 and hibernate3. We have a central database and a bunch of administration databases. I wish I could define multiple har mbeans in one har's hibernate-service.xml. However, the jboss wiki page http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHibernate3 mentions that "Only one org.jboss.hibernate.jmx.Hibernate MBean may be defined within a given hibernate-service.xml descriptor". Does this means that if I want to have another sessionfactory, I need to create another har file? If so, can I have the same set of .hmb files in these hars? The situation is made worse by the fact that we cannot have an exploded har inside an exploded ear. In production, we always deploy exploded ear so that support can modify some configurations. The same thing for har. We would like to modify har's config in the middle of our production. Is it a good idea to clone one har mbean at runtime (using MBeanServer API) and modify its datasource attribute and then use the new instance of mbean for the second database? This is what I did before but not sure it is a good idea. What about those hbm mappings? If I just clone the har mbean, does the new sessionfactory can see those mappings defined in another sessionfactory? Thanks and I am looking forward to some advices. Richard View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3891646#3891646 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3891646 |