简体   繁体   中英

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:-)

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.

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.

You might find this presentation from PGCon interesting:

To ORM or not to ORM

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM