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.  [ 6 posts ] 
Author Message
 Post subject: Session-specific statistics
PostPosted: Sat Aug 25, 2007 6:51 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
Hibernate version:
Hibernate 3.2.2 GA

Name and version of the database you are using:
MySQL Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2


I know Hibernate offers plenty of statistics for the session factory, but I was wondering whether it is possible to get a hold of similar information for one single session. More specifically; I'm asking about the number of queries performed on the sql backend database. I'm reusing my session factory so that I have to make it only once and then spawn sessions off that, but I'd still like to know how many mysql queries were used in one session between its creation and its committing.

Is there a way to do this? I know there are SessionStatistics but these appear to only contain information on the number of cached entities and such.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 8:31 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
Any ideas, anyone?

Sorry for the bump.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 05, 2007 5:08 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
bump...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 05, 2007 6:37 am 
Beginner
Beginner

Joined: Tue Apr 25, 2006 10:46 am
Posts: 28
try

http://www.javalobby.org/java/forums/m9 ... l#91839946


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 05, 2007 6:49 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
I've come along that article before (I do use Google) and I'm quite impressed by Hibernate's rich statistics API. But as I've stated in the OP, these statistics are all based on session factories, which means that they accumulate. What I need is the number of sql queries that were performed in a single session, starting with the session being opened to the point where it is closed. I'm building a web application and I'm using the "one session per page request" pattern and I'd really like to be able to see how much queries each request costs.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 7:18 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
Is my requirement that exotic that nobody has encountered something like this before?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

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.