• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Integration Of Spring with Hibernate using Oracle Database

 
Ranch Hand
Posts: 51
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,
Problem Scenario:Putting dataSource from Persistence.xml and ApplicationContext.xml at one place.
Details:-
I am having a tough time integrating Hibernate with Spring framework. I am following strict JPA guidelines in the framework. So I am having one persistence.xml and some orm.xml which basically contains the mapping. In my persistence.xml I am providing the dataSource as hibernate standards.Everything is working fine with this configuration:-


In my applicationContext.xml(Spring xml) I am doing


But the point is that I don't want to declare give my db details at two places. Putting all db details in application context makes more sense. So i tried integrating using sessionFactory bean concept provided at various sites but still have no success.
I am trying to all this new bean in my applicationContext.xml



Can you please provide me a good example how to put all my datasource at one place.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not need the sessionfactory bean, you are using a LocalContainerEntityManagerFactoryBean. You can just remove the db connection details from the persistence.xml, it is not needed there.
 
Your mind is under my control .... your will is now mine .... read this tiny ad
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!