-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to (1) Make Hybernate run fast (2) debug hibernate SQL
PostPosted: Tue Nov 15, 2005 11:34 am 
Newbie

Joined: Fri Nov 11, 2005 12:55 pm
Posts: 6
I have couple of questions about Hibernate.

(1) How to make Hibernate run fast?

The application (Java accessing Oracle database through Hibernate) is taking long time with hibernate to come up. When i turn off the debug output from Hibernate (<property name="show_sql">false</property>), it didn't help that much. And i think, as the data in database grows, the hibernate application is going to take more time. Isn't it right? Please let me know how to make it fast?

(2) How debug to hibernate SQL?

I set the property ((<property name="show_sql">true</property>) to "true" to see the SQL executed by hibernate. I see number of SQL statements with ? mark at the end as shown below. If it breaks (assume with following sql), then it's really difficult to find out the value for ? mark. Is there any way to find out the actual SQL passed to database from Hibernate? It can save a lots of debugging time if i know which value the ? mark is having when Hibernate couldn't execute SQL and throws exception.

-----------------------------------
select instrument0_.col as INS1_0_, from table instrument0_ where instrument0_.col=?
------------------------------


Thanks in advance
Prashant.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 11:43 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Answer to question 2.

Investigate a tool called p6spy which will help you greatly. It will log all your SQL perfectly for you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.