• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Integration Of Spring with Hibernate using Oracle Database

 
Ranch Hand
Posts: 51
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic