-->
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.  [ 4 posts ] 
Author Message
 Post subject: turn on sql logging ?
PostPosted: Mon May 22, 2006 11:59 pm 
Beginner
Beginner

Joined: Fri May 13, 2005 11:21 pm
Posts: 21
Location: Atlanta, GA
I'm trying to diagnose a odd exception in my application :

Code:
2006-05-22 23:34:26,765 [4652] ERROR NHibernate.ADOException [(null)] <(null)> - Could not execute query
System.Data.SqlClient.SqlException: Invalid object name 'PageItemType'.


and I've validated that the PageItemType is a valid object :)

So I'm now trying to see the sql that nhibernate is producing but my log does not appear to be logging sql, I have the log level set to DEBUG.

My other nhibernate apps are just webapps using nhibernate, this application is a DLL using nhibernate and the webapp references it, are there any gotchas I should be looking for ?

Thanks
Grant

_________________
Cheers,
Grant

http://theresidentalien.typepad.com/
http://www.bluetube.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 8:07 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Since this is an SQL Server error, make sure you have the table named PageItemType.

SQL is logged to NHibernate.SQL log4net logger. You can also set hibernate.show_sql to true to log SQL to System.Console.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 9:03 am 
Beginner
Beginner

Joined: Fri May 13, 2005 11:21 pm
Posts: 21
Location: Atlanta, GA
Thanks, I do have a table called PageItemType which is whats throwing me off :) I used puzzle.net object mapper to create my hbm file and I normally do it by hand so I'm running through now trying to figure out what the hell I'm doing wrong :)

It looks like I was mistaken about logging, my logging is working with log4net but I'm not getting any logging out of hibernate and I have the log level set at DEBUG. I've forced log4net to intialize in the Application_Start using log4net.Config.XmlConfigurator.Configure(); but this is in my webapp and nhibernate is being used in my dll, does this make a difference ?

I do see a repository being created in the output console :

Code:
og4net: DefaultRepositorySelector: Creating repository for assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc]
log4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc] Loaded From [c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files\ilearnwebapp\cb2e936e\71e9225d\assembly\dl2\1a367256\00f17686_fd19c601\nhibernate.dll]
log4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc] does not have a RepositoryAttribute specified.
log4net: DefaultRepositorySelector: Assembly [NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc] using repository [log4net-default-repository] and repository type [log4net.Repository.Hierarchy.Hierarchy]
log4net: DefaultRepositorySelector: repository [log4net-default-repository] already exists, using repository type [log4net.Repository.Hierarchy.Hierarchy]


but nhibnerate is not debugging logging to it.

_________________
Cheers,
Grant

http://theresidentalien.typepad.com/
http://www.bluetube.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 10:08 am 
Beginner
Beginner

Joined: Fri May 13, 2005 11:21 pm
Posts: 21
Location: Atlanta, GA
I'm an idiot, figured it out. Have too many open projects and was editing the wrong web.config :) Sorry guys, I'll go stand in the corner and you can throw vegetables at me :)

_________________
Cheers,
Grant

http://theresidentalien.typepad.com/
http://www.bluetube.com


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