On Thu, 18 Dec 2008 14:38:41 -0800, Erland Sommarskog
wrote:
>Erik Sampsell (erik@fuzeboxinc.com) writes:
>> I've just started at a new company that is using java and hibernate to
>> access SQL Server. I tried configuring SQL Profiler to show me what sql
>> calls are being made to the database and I can't see it.
>>
>> Can anyone give me some direction? I'm not familiar with hibernate at
>> all.
>
>I assume you mean nHibernate? No, I don't know anything about it; I've
>only heard the name.
Hibernate is a java O/R mapper, NHibernate is the .NET version - so in
this case he probably is using Hibernate.
>But there is no way that nHibernate can call SQL Server without being
>captured in a trace, so this is probably something really trivial. Maybe
>your filter is poor. Maybe you failed to include both of RPC:Completed and
>TSQL:BatchCompleted. (Include Starting as well, in case all batches errors
>out.) Maybe you are tracing the wrong server. Maybe the application wasn't
>accessing SQL Server while you were tracing.
Yes, there's nothing special about the way (N)Hibernate accesses SQL
Server - I've used profiler to look at the SQL generated by
NHibernate, and it was pretty straightforward. It's also quite easy to
get NHibernate to log the SQL it produces, I don't remember the
details (I think we used log4net), but I suspect something similar can
be done with Hibernate.
--
http://www.sgat-computing-services.co.uk/ >> Stay informed about: Profiler and Hibernate