My configuration:
* Spring\JBoss\Hibernate\Jencks(junit testing)
* 2 datasources(live, and config) therefore 2 sessionFactories - JTA
* 1 named sql-query located within an hbm file
I have a named sql-query in one of my .hbm files. This hbm is loaded by the config sessionFactory. I need to make sure that the named query is executed by the config datasource/sesionFactory.
Currently, Hibernate is trying to execute the named query using the live datasource/sessionFactory which results in a Oracle exception of... "Table or View does not exist"
Is there a way to force this named query to be executed by the config datasource/sessionFactory.
The generic question is - In an environment with multiple datasources/sessionFactories how can you force a named sql-query(from an hbm file) to be executed by a particular sessionFactory/datasource?
Thanks in advance!
|