-->
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.  [ 7 posts ] 
Author Message
 Post subject: unresolved parameter values when show_sql = true
PostPosted: Thu Mar 03, 2005 12:09 pm 
Newbie

Joined: Thu Nov 18, 2004 9:28 pm
Posts: 11
Location: Costa Rica
Hibernate version:
version 2.1.6, 9.8.2004

Is there a way to show the resolved parameter values when displaying an sql statement via the show_sql=true configuration parameter?
It displays the generated which is very helpful but uses '?' instead of displaying the resolved parameter.


Top
 Profile  
 
 Post subject: Use log.debug
PostPosted: Thu Mar 03, 2005 12:12 pm 
Newbie

Joined: Fri Jan 28, 2005 8:58 am
Posts: 9
There is no direct way.

However, if you change your log setting to DEBUG, then you will see a lot of messages giving you details about the values bound to the parameters.

Also, make sure that you have log4j or equivalent in your classpath, as Hibernate uses that for logging.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 12:16 pm 
Newbie

Joined: Thu Nov 18, 2004 9:28 pm
Posts: 11
Location: Costa Rica
ok thanks!

can you please give an example of how to change this setting (DEBUG)?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 1:07 pm 
Newbie

Joined: Fri Jan 28, 2005 8:58 am
Posts: 9
If you use log4j, then there should be a file called log4j.properties.

You can change the setting there (probably it would show as INFO).

If you don't have log4j, then you should add a log4j.properties file in your classpath.

You can get a sample from the Apache Log4j website.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 1:11 pm 
Newbie

Joined: Thu Nov 18, 2004 9:28 pm
Posts: 11
Location: Costa Rica
I do have a lo4j.properties file, I'm sorry but I think I didn't formulate right my question, I'll rephrase it: "what is the exact line that I should add/modify in this properties file to turn on/off DEBUG information for hibernate?"


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 1:53 pm 
Regular
Regular

Joined: Thu Dec 18, 2003 2:14 am
Posts: 103
Location: Brooklyn, NY
for 2.x:
log4j.logger.net.sf.hibernate=debug

for 3.x
log4j.logger.org.hibernate=debug


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 1:57 pm 
Newbie

Joined: Thu Nov 18, 2004 9:28 pm
Posts: 11
Location: Costa Rica
thank you


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.