-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [ANN] HibernateTrace released at JSF-Comp
PostPosted: Sun Dec 24, 2006 3:38 pm 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
I've gathered a JSF component that collects most of the stats&infos from a given sessionFactory and visualizes them on page. It's called HibernateTrace, it's the statistician of your hibernate-based jsf applications.

The component is formed from 6 parts. They are,

1. General statistics
2. Statistics per Query
3. Statistics per Entity
4. Statistics per Collection
5. Second Level Cache Statistics
6. Generated SQLs from logging mechanism (if available)

Here is a screenshot:


Image

You can download the component and a sample-webapp from jsf-comp at sourceforge.

http://sourceforge.net/project/showfiles.php?group_id=137466&package_id=215840

Regards,

Mert..
http://www.jroller.com/page/mert


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 25, 2006 11:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hi,

the component looks good.

One question about the source though - why do you copy all the values when you can just access them directly or delegate to them ?

p.s. did you consider contributing it to hibernate tools which has a (not yet very documented) swingbased statistics browser ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: about HT
PostPosted: Mon Dec 25, 2006 11:38 am 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
Hi Max,

Yes, these are the wrapper classes for now, but i'll also assign to them other duties like tooltip-info collecting and calculation stuff about some pie charts. Those ones are also serializable so I thought it would be better to abstract these implementations from hibernate impl.

I'll be willing to make a contribution to hibernate_tools. Any procedure for this?

Mert..
http://www.jroller.com/page/mert


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 25, 2006 11:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok - fair enough about the additional func; but you do know the statistics them selves are serializable ?

Regarding contributions then it might make more sense to have them in jboss seam or similar - but lets see. The biggest issue in hibernate tools is that we would need to beef up with the jsf dependencies.

In any way you will need to sign a contributor agreement (its just a click through), but let see if/were we can find room for it.

Have you considerede session statistics too ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 25, 2006 11:57 am 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
in 3.2.1ga StatisticsImpl and SessionStatisticsImpl are not serializable. Am I wrong?

You can ping me for the agreement.

Yes I looked into session statistics but I've got exception while retrieving them, I'll be working on it..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 25, 2006 12:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
whoops sorry - yes, the statistics is not serializable. my bad.

I want them to be serializable (or at least able to take snapshot for later comparison)

I'll ping you some time in the new year.

What was the exception you got ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 25, 2006 5:10 pm 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
I also want them to be serializable :)

Ok, looking forward to hear from you...

Actually when i tried to get the current session from sessionFactory, I got the usual exception...
"No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here".


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 25, 2006 7:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
The "usual" exception ?

That exception should not occur - when are you calling getStatistics ?

Maybe it is just because you have a guarded session where we need to allow getStatistics to be called out of txn boundaries (we had to do the same for getSessionFactory)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 26, 2006 4:00 am 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
a "known" exception would be more suitable..
The statistics (also the ones in session) are accessed from uiComponent class and the code is not enclosed in a txn environment. In the sample webapp I only used transactionInterceptor with the beans named *ServiceImpl. and the component accesses the sessionFactory with a valueBinding. It seem to me that there is no problem with the txns. or is it..


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 26, 2006 2:39 pm 
Senior
Senior

Joined: Sun Jun 04, 2006 1:58 am
Posts: 136
I am happy with inbuilt JMX mbean for now ... :)

_________________
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 26, 2006 3:10 pm 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
suit yourself.. :)

i've changed the formRenderer in my projects so at the end of each page, hibernateTrace gets rendered..


Top
 Profile  
 
 Post subject: about criterias..
PostPosted: Tue Dec 26, 2006 3:56 pm 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
And what should be done to get statistics for criterias?
haven't seen any implementation for this.
I also don't wanna live them out.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 26, 2006 5:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well the exception occurs on all methods that is not allowed/supposed to be accessed outside of a txn when you use sf.getCurrentSession().

And i'm saying maybe we are too restrictice about giving access to the statistics....sounds like a bug to me. You should be able to access it inside a tx though ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: about session statistics..
PostPosted: Wed Dec 27, 2006 8:28 am 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
Max,

Yes, I am getting the statistics in a tx environment.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 27, 2006 12:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
but if you were running under a tx then you would not get an exception that says: ""No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here"."

could you show the full trace ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.