[hibernate-dev] exposing statistics easier (HHH-3593 solution)
steve at hibernate.org
Thu Nov 20 14:57:14 EST 2008
Since this code deals with JMX, I'd rather see this functionality as
part of the hibernate-jmx module which I am totally fine making JDK 1.5
specific. The implication of that though is that you'd need to move all
code outside of the hibernate-core module and bootstrap it another way
(perhaps as a SessionFactoryListener).
steve at hibernate.org
Principal Software Engineer
JBoss, a division of Red Hat
steve.ebersole at jboss.com
steve.ebersole at redhat.com
On Thu, 2008-11-20 at 14:47 -0500, John Mazzitelli wrote:
> To be sure, hibernate.generate_statistics is usually not enough if you
> want to use a monitoring tool (since it is generally not the case that
> your monitoring tool is running in the same VM as the hibernate app and
> can access the statistics object directly).
> > The main problem is that it feels odd for Hibernate to be responsible
> > for the Bean Server startup.
> I thought the opposite - I don't like having to ask developers to write
> special code in their apps to be able to peek at their hibernate stats.
> I should be able to take any hibernate application, add a couple
> configuration settings to enable stats and be able to peek at the stats
> from an external monitoring tool.
> As it is right now, given a hibernate app without this special code
> built in somewhere, there is no way for me to monitor it.
> > If we nevertheless go that path, we need to enhance a few things:
> > - sessionFactory.close() should release the Bean Server if it started
> > one initially (good citizen)
> > - sessionFactory.close() should release the MBean
> good points.
> > - it would be nice to find a better way than the *platform* hack (
> > maybe hibernate.generate_statistics.jmx.mbeanserver.plaform = true )
> I didn't go this route because I didn't want two properties setting the
> same thing, and possibly saying two different things. For example, I
> don't want the possibility of someone accidentally doing this:
> ...jmx.mbeanserver = my_mbean_server
> ...jmx.mbeanserver.plaform = true
> That's saying "use the platform MBeanServer" *and* "use the MBeanServer
> with a default domain name of "my_mbean_server". Which takes effect? I
> didn't want someone to do something confusing like this.
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
More information about the hibernate-dev