Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate: memory issues? disadvantages?

Im working with Hibernate 3.6 and until today I couldnt find any disadvantages of using it. But today someone told me that applications using Hibernate will get memory problems when the project gets bigger. This would happen because there would be a lot of objects (hibernate-pojo-objects) which will need to be created and stored, compared to a application which doesnt use hibernate.

is that correct? and are there any more disadvantages of using hibernate? some also told me that working with the objects becomes confusing when the database is really big because of all the dependencies between the objects, but I cant really imagine it. has anybody some experiences with this?

thanks :-)

like image 354
nano7 Avatar asked Jun 08 '11 09:06

nano7


People also ask

Why is Hibernate so slow?

Depending on the number of selected Order entities, Hibernate might need to execute a huge number of queries that significantly slow down your application. This issue is easy to find. Hibernate's session statistics and Retrace provide you with the number of queries that were executed within a given session.

Is Hibernate good for big projects?

Hibernate is a great fit for complex projects with high-performance requirements. You only need to know which features to use and which you should better avoid. During this talk, I will show you how to get the most out of your Hibernate-based persistence layer.

Is Hibernate really useful?

Hibernate– Hibernation is a good option when you know you won't use your laptop for an extended period of time and you are unsure of when you'll have the chance to charge it again. This is also a good option for desktop users concerned about power consumption as it doesn't use as much as sleep mode.


2 Answers

Some of them are :

  • Little or no capabilities for remote access and distributability.
  • Mapping schemas can be tedious and O/R mapping has its tricks like using lazy initialization, eager loading etc. What works for one may not work for another.
  • Limited clustering capabilities.
  • Large data sets can still cause memory issues.
  • Support for security at a database level only and no support for role based security without any add on APIs like Aspect Oriented Programming etc.

Some other people also think that there are disadvantages for Hibernate.

like image 56
Saurabh Gokhale Avatar answered Oct 18 '22 05:10

Saurabh Gokhale


Whenever you add a layer of abstract it has to do extra work and use extra memory to do it. If it uses extra memory, you may need to increase your maximum heap size or buy extra memory which is usually cheap compared to the cost of developer even if those controlling the budgets don't see it that way. This may still cost you less than the development time it save you. Only you can decide if this is worth it.

like image 29
Peter Lawrey Avatar answered Oct 18 '22 07:10

Peter Lawrey