-->
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: executing a named query from hbm file - multiple datasources
PostPosted: Wed Oct 24, 2007 2:21 pm 
Newbie

Joined: Wed Oct 24, 2007 2:04 pm
Posts: 2
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!


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.