I am new to hibernate and Struts �. My application use spring , struts and hibernate mapping.
The requirement is to create a new schema and to fetch the data from both the schemas �.. I need to take data from both the schemas�. Both the schemas are having the same set of tables (Table names are same across the schemas)
In my dataAccessContext-jta.xml , datasource is defined as follows�.
Hibernate's documentation covers configuration. This is a good place to start.
Joined: Jun 22, 2008
Could you please brief on the changes needs to be done. In the dataaccessContext.xml file we have dfined a data source which points to a single database. The Session factory and the transaction manager are mappedd to this data source. How can I define a new datasource and switch the mapping dynamically.
Here Hibernate transaction manager is used. Will this be ok. Please explain .
[ Edited to use code tags - Paul Sturrock ] [ June 23, 2008: Message edited by: Paul Sturrock ]
I'm afraid I don't know much about Spring. Hibernate itself has a one to one mapping between a SessionFactory and a DataSource, and since Spring delegates to Hibernate I can only assume that you need more than one DataAccessContext? In a non-Sping application I would implement this in my DAO layer by switching between SessionFactories dependent on the object I was maintaining; presumably you know from the type which database it belong in? Sorry I can't be of much help how to do this in Spring.
subject: Connecting to two schemas using hibernate