Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate is not the best solutions for data centric applications ?

 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I read somewheere as

'Hibernate is not the best solutions for data centric applications that only uses the stored-procedures to implement the business logic in database. '

I was not clear on above statement. Any ideas, suggestions, links, resources, sample code highly appreciated.Thanks in advance
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with Stored Procedures and Hibernate is that the Oracle 9i and before drivers didn't competely implement the JDBC Specification and therefore Hibernate has caveats/rules for being able to call SP.

1) Only one out parameter.
2) Out parameter must be a Ref Cursor
3) Out parameter must be the first parameter.

Also, SP was the rage back in two tier architecture because of speed, however in a three tier architecture where the middle tier is where business logic goes. Stored Procedures are now the wrong place to put business logic, as it tightly ties you to the database. Also in many cases there might not be a need to always have to call the database, and in some cases might be faster than stored procedures.

Hope that helps

Mark
 
Thanh Ngoc Nguyen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gudim gudi wrote:Hi,

I read somewheere as

'Hibernate is not the best solutions for data centric applications that only uses the stored-procedures to implement the business logic in database. '

I was not clear on above statement. Any ideas, suggestions, links, resources, sample code highly appreciated.Thanks in advance


This statement is true as Hibernate can not process batch sql statement as in store procedure. Loading data from database and fetching into objects, and saving the objects to database after all, Hibernate is absolutely not a fast and effective way to process many database updates at the same time.
 
ahmad seddighi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In essence, Hibernate is designed to map the object-oriented world to the relational world. So, Hibernate is perfect for projects which have a complicated object hierarchy and a complicated DB schema. Hibernate is not the best choice for data-centric applications which just include raw data and business rules on this data are implemented as procedures in the database-side.
-------------------------------------------------------------------------------------------------------------------------------------------
Ahmad Reza Seddighi


Spring Persistence with Hibernate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic