Hi,
I am running hibernate as a MBean in JBoss.
I would like to retreive the HibernateFactory instance from JNDI
so that I can add mapping files to the Hibernate MBean at run time.
The code looks like this:
HibernateService hibernateService = (HibernateService) new InitialContext().lookup(HIBERNATE_SERV_JNDI_NAME);
hibernateService.addMapResource(XXX.hbm.xml);
What should I set the value of HIBERNATE_SERV_JNDI_NAME to?
When I use "java:/hibernate/HibernateFactory", I get an instance of the SessionFactory... but I what I really want is an HibernateService instance... How do I do that?
Thanks
|