New Posts New Posts RSS Feed: Is there a way to see the generated SQL?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Is there a way to see the generated SQL?

 Post Reply Post Reply
Author
akukucka View Drop Down
Newbie
Newbie
Avatar

Joined: 22-Jul-2010
Location: Rochester, NY
Posts: 11
Post Options Post Options   Quote akukucka Quote  Post ReplyReply Direct Link To This Post Topic: Is there a way to see the generated SQL?
    Posted: 27-Jul-2010 at 1:03pm
Hello I was wondering if there is a way to get the generated SQL for logging/debugging purposes. I know there's a way in EF but I haven't been able to find anything for DF.

Thanks!
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 27-Jul-2010 at 3:48pm

You can set the logTraceString to true on the edmKey and the generated sql will be written to the debuglog.

Back to Top
akukucka View Drop Down
Newbie
Newbie
Avatar

Joined: 22-Jul-2010
Location: Rochester, NY
Posts: 11
Post Options Post Options   Quote akukucka Quote  Post ReplyReply Direct Link To This Post Posted: 28-Jul-2010 at 7:17am
That's just what I needed - thanks!
Back to Top
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post Posted: 18-Sep-2010 at 8:34am
Originally posted by davidklitzke

You can set the logTraceString to true on the edmKey and the generated sql will be written to the debuglog.


I can't seem to get this working.  I have a silverlight project running devforce 6.0.5.  I ran the configuration editor against the web.config and made sure the LogTraceString checkbox was checked.  Connection string was set to the database.  I ran the traceviewer but all i get from that  is the following 


Error connecting to net.tcp://localhost:9922/TracePublisher. Error: Could not connect to net.tcp://localhost:9922/TracePublisher. The connection attempt lasted for a time span of 00:00:02.0280035. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:9922. 

I also checked the debuglog.xml and nothing special appears in there.

Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 21-Sep-2010 at 10:22am
 
Any chance this port is blocked and/or already being used?
Besides the SQL statements, does the debuglog.xml seem to be populated properly? (doublecheck timestamps)
 
 
 
Back to Top
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post Posted: 27-Sep-2010 at 12:29am
I don't think the port is being used.  I dropped the firewall just in case.  I couldn't get the trace happening but I can get sql to appear in debuglog.xml now which is all I really need (I had to explicitly put my connection name rather than just use default).  However, I can only see the fetches.  I can't see any update statements
Back to Top
mikewishart View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Feb-2010
Location: Reno, NV
Posts: 49
Post Options Post Options   Quote mikewishart Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2010 at 10:51am
I was curious about this and tried this with no luck:

  <ideablade.configuration version="6.00" xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig">
    <logging logFile="DebugLog.xml" />
    <objectServer remoteBaseURL="http://localhost" serverPort="9009" serviceName="EntityService.svc" >
      <clientSettings isDistributed="true" />
    </objectServer>  
    <edmKeys>
      <edmKey name="App" connection="..." logTraceString="true" />
      <edmKey name="Global" connection="..." logTraceString="true" />
    </edmKeys>

Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2010 at 11:23am
hueha,
 
Are you publishing to the TraceViewer? Otherwise you will only be able to see the debuglog.xml
You need to publish by using: (in Global.asax if Silverlight)
 
IdeaBlade.Core.TracePublisher.LocalInstance.MakeRemotable();
 
You can find detailed information in the API Documentation. Also, you can find some samples using TraceViewer in our DevForce Resource Center.
 
As for not seing update statements, that's because DevForce publishes only what's made available by the Entity Framework.
You can still see all SQL statements by checking the SQL Server Profiler (in the SQL Server Management Studio go to Tools>>SQL Server Profiler).
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2010 at 2:56pm
Hi Mike,
 
You mention you tried with no luck.
By that you mean not getting the SQL inside debuglog.xml or in the TraceViewer?
 
As I mentioned previously, you need to publish the tracing messages in order to see them in the TraceViewer.
Back to Top
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2010 at 10:08pm
Unfortunately I'm using sql express at the moment which doesn't come with a profiler
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down