• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate and stored procedure

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it good to use hibernate in an application which is highly dependent on stored procedures?
Is there any disadvantage in using hibernate in such a scenario?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd say no. Hibernate can support Stored Procedures but Stored Procedures are implicitly database dependent (since thats where they live) so putting an ORM in front of them doesn't make a great deal of sense. That is unless your evental goal is to make your application portable and slowly phase out the SPs?

Hibernate wont be a great disadvantage in this case. All you are doing is replacing one type of boiler plate code (JDBC) with another (Hibenrate) to no great imediate benefit.
 
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
I'll take the opposite opinion from Paul, simply from the fact that if you have Stored Procedures without Hibernate, you will have lots of JDBC code that translates the return results from stored procedures into your Java classes, which I always find error prone and harder to maintain.

That said, there is still lots of merit to Paul's post. For instance, there are lots of ways to get better performance out of Hibernate than through a stored procedure with Caching. And I find that an all SP solution is not flexible, maintainable, and leaves you vendor locked as Paul has said.

Personally, in today's technology, those people that fight for an all SP solution are out of date.

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic