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

is hibernate solved these problem?

 
Kaleeswaran Karuppusamy
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For our next project we decided to use hibernate framework.But my Project Manager have worked experience in tomcat torque who point out some problem when we using ORM framework...
1.We cannot managing db connection( open and close)
2.more complexity when using join query
3.store procedure not supporting
4.suppose student table we need DOB only but in ORM supporting whole object access any performance issues this kind of access.

how hibernate solving these problem,
please suggest me..... i want to report these things to my project manager
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1.We cannot managing db connection( open and close)

You have the same level of connection management as any application that uses a DataSource and conenction pooling does. Why would you need really fine grained support?


2.more complexity when using join query

Not sure what this means. HQL syntax is fairly similar to SQL. Associations mapping can be complex if you want to tune your applciaiton's performance. Normal lazy associations are fairly easy to work with.


3.store procedure not supporting

Hibernate supports stored procedures, with the limitation that the first out parameter must be a result set. If your application relies heavily on SPs, I wouldn't use an ORM (you are database bound anyway).


4.suppose student table we need DOB only but in ORM supporting whole object access any performance issues this kind of access.

The DB performance for accessing single attributes and whole rows will be pretty much identical; there is no tangable saving (from the database's point of view) doing this. You can query for single attributes if you like from Hibernate, it will return the populate POJO or an array of Objects depending on the select clause in HQL. An array of objects will be comparable to normal JDBC I'd imagine, given Hibernate is not doing much more than JDBC does. However, worrying about this sort of thing sounds like an early optimisation. Yes more memory and more processing will happen if you use an ORM than if you don't; however I'd be suprised if this were an issue, especially compared against the extra expense and difficulty of maintaining straight JDBC code as data models change, extra databases are required, changes in transaction handling occur, caching is added or tuned, etc.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice Paul, all I can add is "ditto"

Mark
 
Kaleeswaran Karuppusamy
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want clarify few question further

Normally all are go for stored procedure even a single query execution due to high performance,relation and calculation.i need comparison of caching and stored procedures,caching increase only the data access time(if same data access multiple users simultaneously)not table modification,however in normal application most of the query is written for table modification,so how hibernate caching support table modification and i think EnterpriseJavaBean3.0 and hibernate are identical other than naming convention ,is there any different between EnterpriseJavaBean3.0 and hibernate based on Object Relational Mapping.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kalees Waran:
i want clarify few question further

Normally all are go for stored procedure even a single query execution due to high performance,relation and calculation.i need comparison of caching and stored procedures,caching increase only the data access time(if same data access multiple users simultaneously)not table modification,however in normal application most of the query is written for table modification,so how hibernate caching support table modification and i think EnterpriseJavaBean3.0 and hibernate are identical other than naming convention ,is there any different between EnterpriseJavaBean3.0 and hibernate based on Object Relational Mapping.


I don't understand your first part.

The second I can answer. JPA is a spec that is included with the EJB 3 spec, but you can't really say that JPA is EJB 3.0.

But, Hibernate does implement JPA, but it also has Hibernate specific classes that you can use that is not part of the JPA spec, but Hibernate specific that goes beyond JPA.

Hope that helps

I'll add, don't generalize that 100% of stored procedures are always faster.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic