• 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

why is hibernate with spring also used without utilizing hibernate template feature.

 
Ranch Hand
Posts: 2637
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
spring provides hibernate template but i have seen code where spring is used with hibernate but without utilizing hibernate template feature.Is there some reason that sometimes we should use hibernate with spring but not using hibernate template.?

thanks.
 
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

This link gives the following explanation:

LocalSessionFactoryBean is the preferred way of obtaining a reference to a specific Hibernate SessionFactory, at least in a non-EJB environment. The Spring application context will manage its lifecycle, initializing and shutting down the factory as part of the application.

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Monica. Shiralkar wrote:spring provides hibernate template but i have seen code where spring is used with hibernate but without utilizing hibernate template feature.Is there some reason that sometimes we should use hibernate with spring but not using hibernate template.?

thanks.



If you are using Hibernate but older versions than 3.1, then the template was helpful because it would hide boiler plate Hibernate code.

Since 3.1 Hibernate no longer has any boilerplate code or checked Exceptions, so if you are using Hibernate 3.1 you will get no benefit using the template in Spring.

Mark
 
Monica Shiralkar
Ranch Hand
Posts: 2637
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic