• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Made Easy -- Footprint & Performance

 
Chris Riffle
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cameron good morning,

The deployable version(with bundled jvm) of my desktop app is 40 megabytes. I consider this a reasonable size for users to download from the web. The app uses an internal, standalone hsqldb database with jdbc for manipulation.

I'm interested in integrating hibernate instead of my nasty-looking jdbc sql strings... but concerned that including hibernate library files will make the download file of my app significantly larger. Does your book talk about file size foot prints and choices of minimal installation for basic lib use only?

Also, I read that when initializing/loading a hibernate factory object, it is a somewhat heavyweight process that should be done only once upon app load. Does your book talk about that or provide any workarounds? ... like maybe a background thread.. I don't know. How "heavyweight" is that process?

Congratulations on writing your book! If I don't win I'm going to buy a copy. Have a good day,
Chris




 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was just looking at the lib folder in my web module, and it says the size of all of the required jar files is 11MB. That's not too bad. Plus, that includes all of the various libraries that you probably already have, such as ant.jar, dom4j.jar and commons-loggin.jar. So, that shouldn't overwhelm your network, especially if you're at 40 megs aleady.

The Hibernate SessionFactory is the 'heavyweight' component, but it really won't overwhelm your JVM if used correctly. If you aren't using JNDI, which you wouldn't be on a desktop app, you can cache the SessionFactory using the singleton pattern and the threadlocal scope. Just so long as you're not needlessly creating multiple SessionFactory objects, you'll be okay.

And you'll love Hibernate. I've done plenty of the JDBC SQL statement based programs in the past, so I know your pain. Hibernate really allows you to think of your persistence model in a very object-oriented way, while marshalling your object oriented data persistence code into JDBC behind the scenes. If you're a Java developer, and you're comfortable working with objects, you'll love how Hibernate allows you to approach your data in an object oriented way as well.

-Cameron McKenzie
 
Chris Riffle
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic