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 itlittle (pleasant) surprise.
View the original post :
http://www.jboss.com/index.html?module
Oh I am wrong, you can get the SF from a Session.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040969#4040969
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4040969
___
jboss
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.
View the original post :
http://www.jboss.com
Session session = (Session) entityManager.getDelegate()
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040963#4040963
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4040963
___
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()
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040962#