The saga about Hibernete.

Posted in java by pedro | Saturday, February 24th, 2007 at 3:22 pm

I’ve borrowed book about hibernate. So naturally i want share my experiences with You.

Today we focused on JMX and Hibernate.

Hibernate has two MBean. HibernateServiceMBean which allows you to modify hibernate settings and StatisticsServiceMBean which expose hibernate statistics.

Using jconsole you can change settings, for example you can tell hibernate to write queries to console (very usefull), enabling and disabling cache, setting JDBC parameters, and even changing database access parameters. It is possible to change on the fly all parameters you can set in hibernate.cfg.xml config file.

The second MBean allows you to find out about statistic. So you know about cache hits, entities and collections operations such as fetch, load, remove etc. You can turn on statistic gathering or when you finish you can turn it off.

When you are seeking ORM problems in your application this two MBean are extremely helpful.

I’ve got so much post as drafts, and have no time to finished them. So for now I suggest you to try this MBeans with your application by adding -Dcom.sun.management.jmxromote and running jconsole.

Good luck.

Technorati Tags: ,

Leave a Reply

about me

My name is Sebastian Pietrowski. I've finished Warsaw University as Master degree. During my studies I started work for merlin.pl. The primary language I use is Java but I have also programmed in Python, Ruby and Scala. I worked as a technical solution architect at merlin.pl. infrastructure when we were moving from PL/SQL to J2EE. I engineering a great performance optimized solution that made the application 10 times faster than requirements and 85 times faster as original solution.

Currently, I am working as a Senior Expert at F.Hoffmann-La Roche to help define future roadmap in design and development of Enterprise software at Roche and Genentech and build adoption for new technologies. I'm continuously mentoring new developers, helping them understand how important test driven development is and empowering them to get better at their daily job. I'm involved in many activities which brings new technologies for better and faster development. You can find more details on my LinkedIn profile.

But don’t get me wrong, I am not your typical nerd. I'm a pleasant guy that you can drink a glass of wine with me and talk about a range of topics with. My leisure activities include playing basketball, soccer and listening to music. I try to be pragmatic while staying focused on application performance and tuning with success in my daily work.

My favorite quote from Yoda's and my life’s motto is: Do, or do not. There is no try.