I'm having an issue with a web application I'm building at the moment, that allows users to post quite large chunks of text to a table for the app.
Using ELMAH, for the particular one I'm having an issue with right now, the CONTENT_LENGTH is 595759, however, the insert succeeds and marks what they've posted in the application for approval.
If it helps, it's all done using LINQ.
When the user clicks the approve button in my application (which simply allows them to edit the previously posted data and marks it as approved) I get the below error:
System.Exception: An error occured publishing a page: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statemen开发者_如何学编程t has been terminated.
I'm at a bit of a loss as to how to why this works on the insert but not on update. Can anyone attempt to shed any light on this?
Thanks in advance to any help.
If you want to verify this is database timeout, and you have access to the database, you can view Activity Monitor, or select * from sys.dm_os_waiting_tasks
and see if there is any blocking going on. If there is blocking on locks, you can look at the locks in Activity Monitor or exec sp_lock
or select * from sys.dm_tran_locks
.
I guess your application written in asp.net? if it is this might be asp.net timeout exception rather than sql server timeout.
See this link http://weblogs.asp.net/aghausman/archive/2009/02/20/prevent-request-timeout-in-asp-net.aspx
and
Also try increasing Command timeout property of sql command object(if you are using it)
see details here:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx
精彩评论