none
Processing a lot of items in Windows Service causes that every select executed on WebSite ends with Timeout exception RRS feed

  • Question

  • Hi,

    I have Data Access Library which uses EF5 Code First. This library is used in Windows Service(WS) and asp.net website projects.

    The WS hosts the WCF service which allows you to "begin a transaction", "upload a lot of files" and then "Commit the transaction".

    During the uploading process, I'm able to browse the website without any problems, but when the Commit is called and all documents are stored in DB, the website crash. Every request ends with Timeout exception.

    If I check the connections status using the stored procedure EXEC SP_WHO, I see something like that:

    55 suspended  SELECT
    57 sleeping   AWAITING COMMAND
    58 sleeping   AWAITING COMMAND
    59 suspended  SELECT
    60 runnable   SELECT      

    My connection string is: DataSource=(local); Initial Catalog=<DBName>; Integrated Security=SSPI

    Edit: I'm using the TransactionScope inside the Commit method

    Thanks for any suggestion what can causes the problem?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    • Edited by Lukas.Kubis Monday, September 2, 2013 6:35 AM Additional information
    Friday, August 30, 2013 8:45 AM

Answers

  • I found out that the TransactionScope inside the Commit method causes this issue.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Lukas.Kubis Friday, September 6, 2013 10:28 PM
    Monday, September 2, 2013 6:36 AM

All replies

  • You can increase the Timeout parm on the connection string to give you enough time to complete the process. 

    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx

    Saturday, August 31, 2013 2:31 AM
  • I found out that the TransactionScope inside the Commit method causes this issue.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Lukas.Kubis Friday, September 6, 2013 10:28 PM
    Monday, September 2, 2013 6:36 AM
  • Hello,

    Thanks for posting your question to this forum.

    Glad for finding a solution to the issue.

    If it is possible, could you please share your solution with us.

    Thanks very much.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, September 5, 2013 1:31 AM
    Moderator