Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the need for Integrating Spring and Hibernate ?

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello ,

I am using Spring EJB and Hibernate in the application .

I can find only one use of integrating Hibernate and Spring

Instead of scattering the code across the application for getting reference to the Session from the SessionFactory , we can directly use the HibernateTemplate which is configured on to the XML files.

Is this the only advantage or any other reasons also .

Please specify.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I use Spring and JPA/Hibernate I only use Spring to inject a session into my DAOs (without using the JpaTemplate) and transaction support. For me, Spring brings no other benefit directly to JPA/Hibernate. With EJBs it might be different, I don't really know.
 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gregg ,

In your case that is fine .


Any ideas to share from anybody when using with EJB??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic