Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Integration Of Spring with Hibernate using Oracle Database

 
Vivek Kr Agrawal
Ranch Hand
Posts: 51
Eclipse IDE Java Spring
  • 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.
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic