Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> SqlTimeout view sql text
 

Pages: 1
Bugs & Issues
SqlTimeout view sql text
Page:1/1 

  Print all messages in this thread  
Poster Message
WayneBrantley
User



Location:
USA
Joined on:
10-Mar-2006 16:20:08
Posted:
1112 posts
# Posted on: 12-Mar-2019 14:50:54.  
I have an SqlTimeout that is happening.
I test what I 'believe' the sql actually is in production and it seems to work fine for me - but I am not quite sure what the actual SQL statement is that is executed. (Parameters and all)

I would like to log that in production. I short when an SqlException is thrown - I would like to be able to access the query text that was executed.

I have tools like RedGate Sql Monitor - but the command is 'canceled' by the client - so does not show up. I also cannot run your profiler in production.

Would like to just catch this exception or turn on some logging for just a single query or really, just be able to log when the exception happens.

Any ideas or thoughts?
SelfServicing, .Net 4.5, Web Applications, SqlServer 2014  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37561 posts
# Posted on: 13-Mar-2019 10:33:04.  
Do you receive an ORMQueryExecutionException? As that object contains the query as text + the parameters with values. https://www.llblgen.com/Documentation/5.5/ReferenceManuals/LLBLGenProRTF/html/78D52C64.htm

A timeout could happen because the query waits for a rowlock which isn't going to get lifted in time. E.g. you try to select from a row that's also being updated but forgot to add the object through which you select (as you use selfservicing) to the transaction and therefore it creates another connection. As the query originates from the same code/thread it will deadlock in that case and therefore you get the timeout. Running the query after that works fine (as in: it's not too slow to timeout) as there's no lock it has to wait for.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
WayneBrantley
User



Location:
USA
Joined on:
10-Mar-2006 16:20:08
Posted:
1112 posts
# Posted on: 13-Mar-2019 15:55:47.  
That's good info, let me run with that and see what I come up with.
Thanks.
SelfServicing, .Net 4.5, Web Applications, SqlServer 2014  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.