-1

Is it possible to get hibernate statistics as generated by hibernate using java melody as per described in this link: http://docs.jboss.org/hibernate/orm/3.6/javadocs/org/hibernate/stat/Statistics.html

RAS
  • 8,100
  • 16
  • 64
  • 86
Jigar Parekh
  • 6,163
  • 7
  • 44
  • 64

1 Answers1

1

I have used a JSP to monitor 2nd level cache.

Very similar to :

http://hibernatestats.blogspot.in/2007/02/page-import-org.html

Samba
  • 607
  • 4
  • 19
  • JSP looks good, i got some information of 2nd level cache using melody which works directly on ehcache. This JSP will provide detail info of hibernate statistics but thinking how to expose session to JSP as using spring managed hibernate environment. – Jigar Parekh Jul 06 '12 at 11:43
  • Load spring's web app context using JSP's session object and then, you can get handle of hibernate session... 'WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(session.getServletContext()); org.hibernate.SessionFactory sessionFactory = ( org.hibernate.SessionFactory) ctx.getBean("sessionFactory");' – Samba Jul 06 '12 at 11:58