Jagdish Gahlot

Greenhorn
+ Follow
since Nov 17, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jagdish Gahlot

No PAUL, i am not getting exception. i defined 2 EMF, 2 DS and 2 PUs.
But i need only 1 EMF and should be able to access 2 database/datasource.
8 years ago
Thanks Sam, and sorry for this silly mistake done.
No i am learning spring data jpa so right now running few samples using main() method itself.
8 years ago
i have started learning spring as per my project requirement. right now we are using Spring data JPA with hibernate. I have created few samples with different approaches like using JpaRepository, Multiple datasource in Spring JPA with hibernate. I am stuck with a small problem in one of my example regarding XML Namespace in my applicationContext.xml. i couldn't find why this xml is causing problem at startup. Below is my applicationContext.xml file, can anyone have a look and tell me what exactly i am missing here?
Error : Cannot find the declaration of element 'beans'

8 years ago
hi Christian.. thanks for your help, your example is completely working but i have one situation where i don't want to declare 2 persistence entity factory bean (LocalContainerEntityManagerFactoryBean) rather than i want to use single persistence factory dealing with multiple PUs which in turn will use multiple Datasources. i tried lots of option but couldn't get.

Is there a way that we can declare one single bean of LocalContainerEntityManagerFactoryBean which will be defining 1 PersistenceUnitManager and that PersistenceUnitManager will define a list of datasources. then how my DAO will use these Datasources (either of them at a time) ? also in persistence.xml file i will define 2 persistence unit name bt how there PU name will be linked with datasources defined in my applicationContext.xml 's datasources. i hope everyone is getting what i mean to say exactly.

please help.
8 years ago
please anyone could provide a good working example, as searching over internet i couldn't find any working approach, there are lots of post on internet might they are working few as well but as a newbie to spring i don't know whether i should declare 2 entity manager factory for both these DS? because Spring documentation says there should be only one entity manager factory (http://static.springsource.org/spring/docs/2.5.x/reference/orm.html)

below are couple of links but could anyone provide a full working helloworld kind of prototype.

http://static.springsource.org/spring/docs/2.5.x/reference/orm.html
http://forum.springsource.org/archive/index.php/t-34301.html
http://stackoverflow.com/questions/1902997/multiple-database-with-springhibernatejpa
8 years ago