none
Powershell memory leaking / memory usage RRS feed

  • Question

  • Hi,

    I have trying to do some connections to a remote database and do a whole lot of reads. No no writing back to the db. So I am doing this in .net using a SQLreader. However occasionally it seems to cause a timeout with other connections to the database from a separate application.

    So I always have to open the db execute the sql reader then close the connection.

    what I am wondering is if I am using the dataset method even though I might get lower speed would it be gentler on the db and less likely to cause issues. The other apps like my app connect over a wan link as does my application.

    The issue they get seem to be timeout related as well.

    I am also thinking since the sql reader has to iterate through each result it might then a dataset that gets it all back in one hit.

    So please advise thanks on my best options.

    Thanks,

    Ward
    Saturday, December 7, 2013 12:52 PM

Answers

  • You cannot cause timeouts on a database if you are just reading. If there are timeouts then the database has issues and should be fixed.

    AQ dataset still uses a reader only in a different way.  It my have a slightly different impact. 

    If a single client can cause disruption to a database then the database is not much good.  You may be missing patches or have a bad database design.  Corrupt indexes can also cause read locks to lock a system.  Since this is intermittent it is not a self-lock issue but more likely another process that is causing the issue.

    I recommend creating a very simple reader script and testing the database with a debugger.

    I also recommend posting questions like this to the MSSQLServer forum.  It is not really a scripting issue but more one of how to use and troubleshoot a specific product.  The MSSQLServer people should be better equipped to assist you.


    ¯\_(ツ)_/¯

    • Marked as answer by WardH Saturday, December 7, 2013 1:34 PM
    Saturday, December 7, 2013 1:15 PM

All replies

  • You cannot cause timeouts on a database if you are just reading. If there are timeouts then the database has issues and should be fixed.

    AQ dataset still uses a reader only in a different way.  It my have a slightly different impact. 

    If a single client can cause disruption to a database then the database is not much good.  You may be missing patches or have a bad database design.  Corrupt indexes can also cause read locks to lock a system.  Since this is intermittent it is not a self-lock issue but more likely another process that is causing the issue.

    I recommend creating a very simple reader script and testing the database with a debugger.

    I also recommend posting questions like this to the MSSQLServer forum.  It is not really a scripting issue but more one of how to use and troubleshoot a specific product.  The MSSQLServer people should be better equipped to assist you.


    ¯\_(ツ)_/¯

    • Marked as answer by WardH Saturday, December 7, 2013 1:34 PM
    Saturday, December 7, 2013 1:15 PM
  • Hi,

    Thanks for your reply. I made a boo boo and put the wrong text in the question - mean to post this one somewhere else. So I will get a powershell question soon.

    But great answer thanks for the advice :)

    Ward.

    Saturday, December 7, 2013 1:36 PM