-->
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: How to know the number of queries made to DB?
PostPosted: Wed Nov 08, 2006 1:29 pm 
Newbie

Joined: Thu May 04, 2006 8:21 am
Posts: 4
Where can I know the number of queries to DB made during the Session? This will be very helpful for optimization purposes.

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 2:13 pm 
Regular
Regular

Joined: Thu Aug 24, 2006 2:05 am
Posts: 80
If you are using SQL 2000/05 Server then use query profiler to see the queiries fires by nHibernate

Steps to Run Profiler:

1.Run Profiler available in Program Files->Microsoft SQL Server ->Profiler
2. GO to File->New Trace
3. Run the trace and see the queries fired :)

All the best.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 2:22 pm 
Newbie

Joined: Thu May 04, 2006 8:21 am
Posts: 4
:)

Thank you, but I meant other thing.

I was wondering - if Session or Transaction contains a counter for runned queries - but I couldn't find such counter in code. I want to show the number of queries to DB in the footer of the page.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 2:53 pm 
Beginner
Beginner

Joined: Sat Sep 09, 2006 5:55 am
Posts: 23
I thought I saw in the roadmap that Statistics were going to be ported from Hibernate for the 1.2 release (can't check now 'cause jira seems to be down atm).

More info on statistics for (java) hibernate can be found here:
http://www.javalobby.org/java/forums/t19807.html

Update: seems like I was wrong, there is an issue for it in Jira (http://jira.nhibernate.org/browse/NH-786), but it is not planned and seems to be postponed even.

_________________
Cheers,

Guy Mahieu


Last edited by guymahieu on Thu Nov 09, 2006 7:48 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 6:41 am 
Beginner
Beginner

Joined: Fri Oct 20, 2006 8:02 am
Posts: 36
may be lgo4net can solve your problem.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 6:55 am 
Newbie

Joined: Thu May 04, 2006 8:21 am
Posts: 4
Maybe - if I intercept log4net output and analizy it with regular expressions to detect queries to DB :)

My target it to show in the page footer something like "Page generated in 0.134 sec (12 queries to DB)". I already show the page generation time and trying to solve the second one task - number of queries to DB :)


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.