This content has been marked as final.
Show 5 replies
-
1. Re: How to gather Hibernate Statistic when using seam manage
spambob Apr 26, 2007 9:19 AM (in response to elikyip)I might be wrong but you are probably able to cast the injected entitymanager to org.hibernate.ejb.HibernateEntityManager, and then do
castedEntityManager.getSession().getSessionFactory() / getStatistics()
-
2. Re: How to gather Hibernate Statistic when using seam manage
pmuir Apr 26, 2007 9:23 AM (in response to elikyip)Session session = (Session) entityManager.getDelegate()
-
3. Re: How to gather Hibernate Statistic when using seam manage
christian.bauer Apr 26, 2007 9:30 AM (in response to elikyip)I think it is a better idea to access the statistics via the Hibernate JMX statistics MBean. I don't see an easy way to get access to the SessionFactory programmatically if you are working with JPA. You can't get it from the Session/EntityManager.
-
4. Re: How to gather Hibernate Statistic when using seam manage
christian.bauer Apr 26, 2007 9:31 AM (in response to elikyip)Oh I am wrong, you can get the SF from a Session.
-
5. Re: How to gather Hibernate Statistic when using seam manage
elikyip Apr 26, 2007 11:26 AM (in response to elikyip)Thanks Christian.
There is a method call in Session to get its SessionFactory...i have to look at the api more careful :-) ... I was not expecting a Session to be aware of the factory that creates it....little (pleasant) surprise.