-->
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.  [ 3 posts ] 
Author Message
 Post subject: Logging SQL statement and bind parameter values on SQL error
PostPosted: Fri Jun 25, 2004 6:03 pm 
Newbie

Joined: Fri Jun 25, 2004 5:50 pm
Posts: 3
In an existing system whenever we encounter a database error we dump the affected SQL statement and the values of relevant bind parameters to a log file. This is extremely useful for debugging a production environment with many concurrent users, where we don't want to enable global SQL tracing. We would like to obtain the same behavior from Hibernate 2.1.4, e.g. attach the SQL statement string and bind parameter values to the HibernateException so it can be made visible in the log file. Has anyone managed to do this, or does this require code changes in Hibernate?

_________________
Felix Hack
felix_hack@splwg.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 1:27 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
would say code change, since you don't know yet there is an error when the statements are logged

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 3:18 pm 
Newbie

Joined: Wed May 12, 2004 5:12 pm
Posts: 8
Location: Frankfurt / Germany
I think you could do this with queries using the getQueryString() Method on Query, so you have the hibernate queries at least.

For the rest I agree with emmanuel: code change


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